home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 32 / Mac Magazin and MacEasy Magazine CD - Issue 32.iso / Grafik & Text / OzTeX3.0 / TeX-docs / gentle.tex < prev    next >
Text File  |  1996-04-02  |  193KB  |  5,347 lines

  1. %&Plain
  2. %% Thanks for your interest in A Gentle Introduction to TeX.
  3. %% Any comments on this manual would be appreciated. These may
  4. %% be typesetting, English, or TeX criticisms. If you decide to
  5. %% translate this document into another language, I'd appreciate
  6. %% receiving a copy.
  7. %%
  8. %% This file is a complete TeX input file.  Just run it
  9. %% through TeX and print out the resulting "DVI" file. If you are
  10. %% familiar with TeX, the macros at the top of the file have a few
  11. %% switches which you may want to set.  If you have problems or
  12. %% can't run TeX at all, write to me and I'll send you a hard copy.
  13. %% You can get a bound copy from the TeX Users Group at the address
  14. %% given below.
  15. %%
  16. %% You should feel free to photocopy and/or distribute this manual.
  17. %% My only request is that it remain in one piece and not be chopped
  18. %% up.  The only machine dependent section (#1.2) may need to be
  19. %% rewritten for your local site, of course.
  20. %%
  21. %%%                Michael Doob
  22. %%                 Department of Mathematics
  23. %%                 The University of Manitoba
  24. %%                 Winnipeg, Manitoba  R3T 2N2
  25. %%                 Canada
  26. %%                 mdoob@uofmcc                    (bitnet)
  27. %%                 mdoob@ccu.umanitoba.ca          (internet)
  28. %%
  29. %% Here is a character listing to check to be sure that no
  30. %% unwanted translations took place within the bowels of the net.
  31. %% Upper case letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  32. %% Lower case letters: abcdefghijklmnopqrstuvwxyz
  33. %% round parentheses, square brackets, curly braces: ()  []  {}
  34. %% Exclaim, at, sharp, dollar, percent: ! @ # $ %
  35. %% Caret, ampersand, star, underscore, hyphen: ^ & * _ -
  36. %% vertical bar, backslash, tilde, backprime, plus: | \ ~ ` +
  37. %% plus, equal, prime, quote, colon: + = ' " :
  38. %% less than, greater than, slash, question, comma: < > / ? ,
  39. %% period, semicolon: . ;
  40. %%
  41. %%
  42. %%
  43. %% Now here come the macros used in this manual. If you are
  44. %% already familiar with TeX, you may want to fiddle with them.
  45. %% In particular, the hooks are left to generate a new control
  46. %% word index and table of contents if you change section 1.2.
  47. %%
  48. %%
  49.  
  50.  
  51.  
  52. %%%%%%%% Here are the fonts other than the sixteen defined in %%%%%%%%
  53. %%%%%%%%%%%%%        plain.tex that are used        %%%%%%%%%%%%%%%%%%
  54.  
  55.        %%%% first, choose between amr or cmr fonts %%%
  56. \newif \ifamrfonts
  57. \amrfontsfalse  % use this line if you use the cmr fonts
  58. %\amrfontstrue  % use this line if you use the old amr fonts
  59.  
  60. \ifamrfonts \font\brm=amr10 scaled \magstep1
  61.       \else \font\brm=cmr10 scaled \magstep1 \fi
  62. \ifamrfonts \font\halfrm=amr10 scaled \magstephalf
  63.       \else \font\halfrm=cmr10 scaled \magstephalf \fi
  64. \ifamrfonts \font\bbrm=amr10 scaled \magstep2
  65.       \else \font\bbrm=cmr10 scaled \magstep2 \fi
  66. \ifamrfonts \font\bbbrm=amr10 scaled \magstep3
  67.       \else \font\bbbrm=cmr10 scaled \magstep3 \fi
  68. \ifamrfonts \font\bbbbrm=amr10 scaled \magstep4
  69.       \else\font \bbbbrm=cmr10 scaled \magstep4 \fi
  70. \ifamrfonts \font\bbbbbrm=amr10 scaled \magstep5
  71.       \else \font\bbbbbrm=cmr10 scaled \magstep5 \fi
  72. \ifamrfonts \font\sf = amssmc10
  73.       \else \font\sf = cmss10 \fi
  74. \ifamrfonts \font\chapfont=ambx10 scaled \magstep2
  75.       \else \font\chapfont=cmbx10 scaled \magstep2 \fi
  76. \ifamrfonts \font\secfont=ambx10 scaled \magstep1
  77.       \else \font\secfont=cmbx10 scaled \magstep1 \fi
  78. \ifamrfonts \font\sc= amcsc10
  79.       \else \font\sc= cmcsc10 \fi
  80. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  81.  
  82.  
  83. %%%%\vbadness=10000 %%%%%% I don't want to hear about underfull vboxes
  84. \raggedbottom      %%%%% delete this line for aligned page bottoms
  85. \hsize=5.5in
  86. \vsize=7in
  87. \voffset=.75in
  88. \parskip=\baselineskip
  89. \widowpenalty=1000 \clubpenalty=1000  %%% I hate widows and orphans! %%%
  90.  
  91. %%%%%%%%% choosing between Canadian and American spellings %%%%%%%%%
  92. \newif \ifcanspell
  93. \canspelltrue      %%%% Canadian spelling
  94. %\canspellfalse    %%% use this line for American spelling
  95.  
  96. \def\aesthetic{\ifcanspell \ae{}sthetic\else esthetic\fi}
  97. \def\analogue{\ifcanspell analogue\else analog\fi}
  98.      \let\analog=\analogue
  99. \def\cancelled{\ifcanspell cancelled\else canceled\fi}
  100.      \let\canceled=\cancelled
  101. \def\centimetre{\ifcanspell centimetre\else centimeter\fi}
  102.      \let\centimeter=\centimetre
  103. \def\centre{\ifcanspell centre\else center\fi}
  104.      \let\center=\centre
  105. \def\centred{\ifcanspell centred\else centered\fi}
  106.      \let\centered=\centred
  107. \def\our{\ifcanspell our\else or\fi}
  108. \def\postcode{\ifcanspell postalcode\else zipcode\fi}
  109. \def\province{\ifcanspell province\else state\fi}
  110. \def\theatre{\ifcanspell theatre\else theater\fi}
  111.      \let\theater=\theatre
  112. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  113.  
  114.  
  115. %%%%%%%%%%%%%%%%%%%%%%% headline routines %%%%%%%%%%%%%%%%%%%%%%%%%%%%
  116. \def\gentleheadline{%
  117.     \vbox {\hrule%
  118.         \line {\strut \vrule \quad \tenrm A \TeX{} intro
  119.               \ifcanspell (Canadian \else (U.S. \fi spelling)
  120.               \hfil
  121.               \ifnum \secnum > 0 Section \the\secnum: \fi \sectiontitle \quad
  122.               \vrule}%
  123.         \hrule}%
  124. }
  125.  
  126. \newif \iftitlepage    \titlepagetrue
  127. \headline=
  128.   {\iftitlepage \hfil \global\titlepagefalse \else \gentleheadline \fi}
  129. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  130.  
  131. %%%%%%%%%%%%%%%%%%%% define contents and index files %%%%%%%%%%%%%%%%%%%%%%
  132. %%% Normally the contents and index are hard coded into the input file. %%%
  133. %% To generate new ones, use \writingcontentstrue and \writingindextrue. %%
  134.  
  135. \newif \ifwritingcontents
  136. \newif \ifwritingindex
  137. \newwrite\contents         \newwrite\index
  138.  
  139. \writingcontentsfalse      \writingindexfalse
  140. %%% \writingcontentstrue  %%% use this line to make the contents
  141. %%% \writingindextrue     %%% use this line to make the index
  142.  
  143. \ifwritingcontents \openout\contents=contents.tex     \fi
  144. \ifwritingindex \openout\index=index.tex
  145.           \def\toindex#1{\immediate\write\index{#1 \the\pageno}}
  146.           \else \def\toindex#1{} \fi
  147. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  148.  
  149. %%%%%%%%%%%%%%%%%%%% determine whether answers are printed %%%%%%%%%%%%%%%%
  150. \newif \ifwritinganswers
  151. \writinganswersfalse        %%% use this line to suppress answer section
  152. \writinganswerstrue         %%% use this line to include answer section
  153. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  154.  
  155. %%%%%%%%%%%%%%%%      footnote macro with counter      %%%%%%%%%%%%
  156. \newcount\footnotenum \footnotenum=0
  157. \def\fnote#1{\advance \footnotenum by 1%
  158. \footnote{$^{\the\footnotenum}$}{#1}}
  159. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  160.  
  161.  
  162.  
  163. %%%%%%%%%%%%%%%% exercise, section, and subsection macros %%%%%%%%%%%%
  164. \newcount\exno                   %%%%%% counter for exercises %%%%%%%%
  165. \newcount\secnum \secnum=0       %%%% counter for section numbers %%%%
  166. \newcount\subsecnum
  167.  
  168. \def\section#1{
  169.             \vfill\eject %%%%% new section starts on a new page
  170.             %%%\ifodd\pageno \else\ \vfill\eject \fi %start on an odd page
  171.             \advance\secnum by 1 \subsecnum=0 \exno=0
  172.             \ifnum \secnum = 1 \pageno=1 \fi
  173.             \ifnum \secnum > 0
  174.                  \leftline{\chapfont Section \the\secnum}
  175.                  \vskip 3pt \fi
  176.             \leftline{\chapfont #1}
  177.             \def\sectiontitle{#1}
  178.             \vskip\baselineskip
  179.             \hrule
  180.             \vskip 1cm
  181.             \ifwritingcontents \write\contents{\string\line\string{#1
  182.                    \string\dotfill{}
  183.                    \ifnum \pageno < 0 \romannumeral-\pageno
  184.                    \else \the\pageno \fi
  185.                    \string}}\fi
  186.             \titlepagetrue}
  187.  
  188. \def\subsection#1{\advance\subsecnum by 1
  189.                \vskip 30pt
  190.                \leftline{\secfont \the\secnum .\the\subsecnum\ #1}
  191.                \nobreak
  192.                \ifwritingcontents
  193.                      \write\contents{\string\line\string{\string\qquad{}#1
  194.                      \string\dotfill{} \the\pageno\string}}\fi
  195.                  }
  196.  
  197. \def\exercise{\global\advance \exno by 1
  198.          \vskip\baselineskip
  199.          \noindent $\triangleright$ Exercise \the\secnum.\the\exno\quad
  200.          }
  201. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  202.  
  203.  
  204. %% definitions of control sequences for characters in the typewriter font %%%
  205. %%%% for short phrases this is easier than using a literal construction %%%%
  206. \def\\{\char92{}}          %%%%% backslash %%%%%
  207. \def\lb{\char'173{}}       %%%%% left brace %%%%%
  208. \def\rb{\char'175{}}       %%%%% right brace %%%%%
  209. \def\sp{\char32{}}         %%%%% special space symbol %%%%%
  210.  
  211. \def\beginliteral{
  212. \vskip\baselineskip
  213. \begingroup
  214. \tt
  215. \obeylines
  216. %{\obeyspaces\global\let =\ }
  217. \catcode`\@=0
  218. \parskip=0pt\parindent=0pt
  219. \catcode`\$=12\catcode`\&=12\catcode`\^=12\catcode`\#=12
  220. \catcode`\_=12\catcode`\~=12
  221. \def\par{\leavevmode\endgraf}
  222. \catcode`\{=12\catcode`\}=12\catcode`\%=12\catcode`\\=12
  223. }
  224.  
  225. \def\endliteral{\endgroup}
  226. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  227.  
  228.  
  229. %%%%%%%%%%%%%% inhibit hyphenation of typewriter text %%%%%%%%%%%%%%
  230. \hyphenchar\tentt=-1
  231.  
  232.  
  233. %%%%%%%%%%%% grouping to make input listing in typewriter type %%%%%%%
  234. \def\beginuser{\vskip\parskip
  235.                \everypar={\nobreak}
  236.                \begingroup
  237.                \tt \obeylines \parskip=0pt \parindent=0pt}
  238.  
  239. \def\enduser{\endgroup}
  240.  
  241.  
  242. %%%%%%%%%%% macro to construct tables (easily) %%%%%%%%%%%%%%%%
  243. %%% parameters: title goes between brackets, rest of the
  244. %%%             paragraph is the table
  245. \def\maketable[#1]#2\par{
  246. \setbox1=\vbox{#2}
  247. $$\vbox{
  248.         \hbox to \wd1{\bf \hss #1 \hss}
  249.         \vskip 12pt
  250.         \box1
  251.        }
  252. $$
  253. }
  254. %%%%%%%%%%%  end of macro to construct tables  %%%%%%%%%%%%%%%%
  255.  
  256.  
  257.  
  258. %%%%%%%%%%% macro to put a box around the text %%%%%%%%%%%%%%%%
  259. \def\makebox#1#2#3% vsize, hsize, inserted text
  260. {\hbox{\vrule
  261.        \vbox to  #1{\hrule \vss
  262.                    \hbox to #2{\hss#3\hss}\vss
  263.                    \hrule}\vrule}}
  264.  
  265. \def\displaytext#1{$$\hbox{#1}$$}
  266.  
  267. \def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em
  268.    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
  269.  
  270. \def\AMSTeX{{$\cal A$}\kern-.1667em\lower.5ex\hbox
  271.  {$\cal M$}\kern-.125em{$\cal S$}-\TeX}
  272.  
  273.  
  274. %%%%%%%%%%%% macro to put TeX references in right margin %%%%%%%%
  275. \newdimen\theight
  276. \def \TeXref#1{%
  277.              \vadjust{\setbox0=\hbox{\sevenrm\quad\quad\TeX book: #1}%
  278.              \theight=\ht0
  279.              \advance\theight by \dp0    \advance\theight by \lineskip
  280.              \kern -\theight \vbox to \theight{\rightline{\rlap{\box0}}%
  281.              \vss}%
  282.              }}%
  283. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  284.  
  285. \def\version{1.03}
  286.  
  287. %%%%%%%%%%%% macro to write the date out the date and time %%%%%%%%%%%
  288. %%%%%%%%%%%%          TeXbook   p. 406 for date            %%%%%%%%%%%
  289. \def\today{\ifcase\month\or January\or February\or March\or April\or
  290. May\or June\or July\or August\or September\or October\or November\or
  291. December\fi \space\number\day, \number\year}
  292.  
  293. \newcount\hour \newcount\minute
  294. \hour=\time  \divide \hour by 60
  295. \minute=\time
  296. \loop  \ifnum \minute > 59 \advance \minute by -60 \repeat
  297. \def\writetime{\ifnum \hour<13 \number\hour:%  % supresses leading 0's
  298.                       \ifnum \minute<10 0\fi%  % so add it it
  299.                       \number\minute
  300.                       \ifnum \hour < 12 \ A.M. \else \ P.M. \fi
  301.       \else \advance \hour by -12 \number\hour:%  % supresses leading 0's
  302.                       \ifnum \minute<10 0\fi%     % add it in
  303.                       \number\minute \ P.M. \fi}
  304.  
  305. \def\datestamp{\vfill
  306.     \rightline{\sevenrm Gentle Intro \version{} run through \TeX{}
  307.                on \today{} at \writetime}}
  308. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  309.  
  310. \titlepagetrue
  311. {\nopagenumbers
  312. \def\sectiontitle{Introduction}
  313. \topinsert \vskip 6 cm \endinsert
  314. \centerline{\chapfont A Gentle Introduction to \TeX{}}
  315. \vskip 15 pt
  316. \centerline{\secfont A Manual for Self-study}
  317. \vskip 3cm
  318. \leftline{Michael Doob}
  319. \leftline{Department of Mathematics}
  320. \leftline{The University of Manitoba}
  321. \leftline{Winnipeg, Manitoba, Canada R3T 2N2}
  322. \vskip\baselineskip
  323. \leftline{MDOOB@UOFMCC.BITNET}
  324. \leftline{MDOOB@CCU.UMANITOBA.CA}
  325.  
  326. \vfill\eject
  327. \titlepagetrue.
  328. \vfill\eject
  329. }
  330. \secnum=-2 \pageno=-1
  331.  
  332. \section{Introduction}
  333.  
  334. First the bad news: \TeX{} is a large and complicated program that
  335. goes to extraordinary lengths to produce attractive typeset material.
  336. This very complication can cause unexpected things to happen at times.
  337. Now the good news: straightforward text is very easy to typeset using
  338. \TeX\null.  So it's possible to start with easier text and work up to
  339. more complicated situations.
  340.  
  341. The purpose of this manual is to start from the very beginning and
  342. to move towards these more complicated situations.  No previous knowledge
  343. of \TeX{} is assumed. By proceeding a section at a time, greater
  344. varieties of text can be produced.
  345.  
  346. Here are a few suggestions: there are some exercises in each
  347. section.  Be sure and do them! The only way to learn \TeX{} is
  348. by using it.  Better yet, experiment on your own; try to make
  349. some variations on the exercises.  There is no way that you can
  350. damage the \TeX{} program with your experiments.  You can find a
  351. complete answer to most exercises by looking at the \TeX{} source
  352. file that was used to produce this document.  You'll notice that
  353. there are references in the right margin to {\bf The \TeX
  354. book}\fnote{Addison-Wesley, Reading,Massachusetts, 1984, ISBN
  355. 0-201-13488-9}\null.  When you feel that you want more
  356. information on a topic, that's where to look.
  357.  
  358. Incidentally, there are a few fibs that appear in this manual;
  359. they are used to hide complications (I look at this as something
  360. like poetic license).  As you become more experienced at using
  361. \TeX{}, you'll be able to find them.
  362.  
  363. \TeX{} is a public domain program that is available for no
  364. license fee.  It was developed by Donald Knuth at Stanford
  365. University as a major project. In the profit-oriented market
  366. place, the program would certainly cost many thousands of
  367. dollars.  The \TeX{} Users Group (TUG) is a nonprofit
  368. organization which distributes copies of \TeX{}, this manual,
  369. updates software, and gives information about new developments in
  370. both hardware and software in its publications TUGboat and \TeX
  371. niques.  Joining this users group is inexpensive; please consider
  372. doing so.  The address is:
  373. \vskip\baselineskip
  374. \centerline{\TeX{} Users Group}
  375. \centerline{P.O. Box 9506}
  376. \centerline{Providence, RI 02940}
  377. \centerline{U.S.A.}
  378.  
  379. This manual would not have come into being without the aid of others.
  380. In particular the proofreading and suggestions of the following
  381. people have been invaluable:
  382. \begingroup
  383. \frenchspacing
  384. Waleed A.~Al-Salam (University of Alberta),
  385. Debbie L.~Alspaugh (University of California),
  386. Nelson H.~F.~Beebe (University of Utah),
  387. Barbara Beeton (American Mathematical Society),
  388. Anne Br\"uggemann-Klein (University of Freiburg),
  389. Bart Childs (Texas A.~\&~M\null. University),
  390. Mary Coventry (University of Washington),
  391. Dimitrios Diamantaras (Temple University),
  392. Roberto Dominimanni (Naval Underwater Systems Center),
  393. Lincoln Durst (Providence, RI),
  394. Victor Eijkhout (University of Nijmegen),
  395. Moshe Feder (St. Lawrence University),
  396. Josep~M.~Font (Universidad Barcelona),
  397. Jonas de Miranda Gomes
  398.         (Instituto de Matematica Pura e Aplicada - Brazil),
  399. Rob Gross (Boston College),
  400. Klaus Hahn (University of Marburg),
  401. Anita Hoover (University of Delaware),
  402. J\"urgen Koslowski (Macalester College),
  403. Kees van der Laan (Rijksuniversiteit Groningen),
  404. John Lee (Northrop Corporation),
  405. Silvio Levy (Princeton University),
  406. Robert Messer (Albion College),
  407. Emily H.~Moore (Grinnell College),
  408. Young Park (University of Maryland),
  409. Craig Platt (University of Manitoba),
  410. Kauko Saarinen (University of Jyv\"askyl\"a),
  411. Jim Wright (Iowa State University),
  412. and
  413. Dominik Wujastyk (Wellcome Institute for the History of Medicine).
  414.  \endgroup
  415.  
  416. In addition several people have sent me parts or all of their local
  417. manuals.  I have received a few others on the rebound.
  418. In particular
  419. \begingroup
  420. \frenchspacing
  421. Elizabeth Barnhart (TV Guide),
  422. Stephan v.~Bechtolsheim (Purdue University),
  423. Nelson H.~F.~Beebe (University of Utah)
  424.              and Leslie Lamport (Digital Equipment Corporation),
  425. Marie McPartland-Conn and Laurie Mann (Stratus Computer),
  426. Robert Messer (Albion College),
  427. Noel Peterson (Library of Congress),
  428. Craig Platt (University of Manitoba),
  429. Alan Spragens (Stanford Linear Accelerator Center, now of Apple Computers),
  430. Christina Thiele (Carleton University),
  431. and Daniel M.~Zirin (California Institute of Technology)
  432. \endgroup
  433. have written various types of lecture notes that have been most helpful.
  434.  
  435. \vfill \eject
  436. \section{Contents}
  437.  
  438. \line{Introduction \dotfill{} i}
  439. \line{Contents \dotfill{} iii}
  440. \line{1.~Getting Started \dotfill{} 1}
  441. \line{\qquad{}1.1 What \TeX{} is and what \TeX{} isn't \dotfill{} 1}
  442. \line{\qquad{}1.2 From \TeX{} file to readable output,
  443.                                         the big set up \dotfill{} 2}
  444. \line{\qquad{}1.3 Let's do it! \dotfill{} 4}
  445. \line{\qquad{}1.4 \TeX{} has everything under control \dotfill{} 7}
  446. \line{\qquad{}1.5 What \TeX{} won't do \dotfill{} 8}
  447. \line{2.~All characters great and small \dotfill{} 9}
  448. \line{\qquad{}2.1 Some characters are more special than others \dotfill{} 9}
  449. \line{\qquad{}2.2 Typesetting with an accent \dotfill{} 10}
  450. \line{\qquad{}2.3 Dots, dashes, quotes,
  451.        $\textfont0=\tenbf \mathinner {\ldotp \ldotp \ldotp }$ \dotfill{} 13}
  452. \line{\qquad{}2.4 Different fonts \dotfill{} 15}
  453. \line{3.~The shape of things to come \dotfill{} 19}
  454. \line{\qquad{}3.1 Units, units, units \dotfill{} 19}
  455. \line{\qquad{}3.2 Page shape \dotfill{} 20}
  456. \line{\qquad{}3.3 Paragraph shape \dotfill{} 22}
  457. \line{\qquad{}3.4 Line shape \dotfill{} 26}
  458. \line{\qquad{}3.5 Footnotes \dotfill{} 27}
  459. \line{\qquad{}3.6 Headlines and footlines \dotfill{} 28}
  460. \line{\qquad{}3.7 Overfull and underfull boxes \dotfill{} 29}
  461. \line{4.~$\Bigl\{$Groups, $\bigl\{$Groups, $\{$and More%
  462.  \setbox0=\hbox{$\biggl\{$} \vrule height \ht0 depth \dp0 width 0pt
  463.     Groups$\}\bigr\}\Bigr\}$ \dotfill{} 31}
  464. \line{5.~No math anxiety here! \dotfill{} 33}
  465. \line{\qquad{}5.1 Lots of new symbols \dotfill{} 33}
  466. \line{\qquad{}5.2 Fractions \dotfill{} 37}
  467. \line{\qquad{}5.3 Subscripts and superscripts \dotfill{} 38}
  468. \line{\qquad{}5.4 Roots, square and otherwise \dotfill{} 39}
  469. \line{\qquad{}5.5 Lines, above and below \dotfill{} 39}
  470. \line{\qquad{}5.6 Delimiters large and small \dotfill{} 40}
  471. \line{\qquad{}5.7 Those special functions \dotfill{} 41}
  472. \line{\qquad{}5.8 Hear ye, hear ye! \dotfill{} 42}
  473. \line{\qquad{}5.9 Matrices \dotfill{} 43}
  474. \line{\qquad{}5.10 Displayed equations \dotfill{} 45}
  475. \line{6.~All in a row \dotfill{} 48}
  476. \line{\qquad{}6.1 Picking up the tab \dotfill{} 48}
  477. \line{\qquad{}6.2 Horizontal alignment with more sophisticated patterns
  478.       \dotfill{} 51}
  479. \line{7.~Rolling your own \dotfill{} 55}
  480. \line{\qquad{}7.1 The long and short of it \dotfill{} 55}
  481. \line{\qquad{}7.2 Filling in with parameters \dotfill{} 57}
  482. \line{\qquad{}7.3 By any other name \dotfill{} 60}
  483. \line{8.~To err is human \dotfill{} 62}
  484. \line{\qquad{}8.1 The forgotten bye \dotfill{} 62}
  485. \line{\qquad{}8.2 The misspelled or unknown control sequence \dotfill{} 62}
  486. \line{\qquad{}8.3 The misnamed font \dotfill{} 64}
  487. \line{\qquad{}8.4 Mismatched mathematics \dotfill{} 64}
  488. \line{\qquad{}8.5 Mismatched braces \dotfill{} 65}
  489. \line{9.~Digging a little deeper \dotfill{} 68}
  490. \line{\qquad{}9.1 Big files, little files \dotfill{} 68}
  491. \line{\qquad{}9.2 Larger macro packages \dotfill{} 69}
  492. \line{\qquad{}9.3 Horizontal and vertical lines \dotfill{} 70}
  493. \line{\qquad{}9.4 Boxes within boxes \dotfill{} 72}
  494. \line{10.~Control word list \dotfill{} 77}
  495. \ifwritinganswers
  496.     \line{11.~I get by with a little help\dotfill{} 80}
  497. \fi
  498.  
  499.  
  500.  
  501. \section{Getting Started}
  502.  
  503. \subsection{What \TeX{} is and what \TeX{} isn't}
  504.  
  505. First of all, let's see what steps are necessary to produce a
  506. document using \TeX\null.  The first step is to type the file
  507. that \TeX{} reads. This is usually called the \TeX{} file or the
  508. input file, and it can be created using a simple text editor (in
  509. fact, if you're using a fancy word processor, you have to be sure
  510. that your file is saved in ASCII or nondocument mode without any
  511. special control characters). The \TeX{} program then reads your
  512. input file and produces what is called a DVI file (DVI stands for
  513. DeVice Independent). This file is not readable, at least not by
  514. humans. The DVI file is then read by another program (called a
  515. device driver) that produces the output that is readable by
  516. humans\TeXref{23}. Why the extra file? The same DVI file can be
  517. read by different device drivers to produce output on a dot
  518. matrix printer, a laser printer, a screen viewer, or a
  519. phototypesetter. Once you have produced a DVI file that gives
  520. the right output on, say, a screen viewer, you can be assured
  521. that you will get exactly the same output on a laser printer
  522. without running the \TeX{} program again.
  523.  
  524. The process may be thought of as proceeding in the following way:
  525. $$
  526. {\hbox{edit text\quad} \atop \longrightarrow}
  527. \lower .6cm \makebox{1.5cm}{1.8cm}%
  528. {\vbox{\hbox{\TeX{}}
  529.        \hbox{input}
  530.        \hbox{file}
  531.        }%
  532. }%
  533. {\hbox{\quad \TeX{} program\quad} \atop \longrightarrow}
  534. \lower .6cm \makebox{1.5cm}{1.8cm}%
  535. {\vbox{\hbox{DVI}
  536.        \hbox{file}}
  537. }%
  538. {\hbox{\quad device driver\quad} \atop \longrightarrow}
  539. \lower .6cm \makebox{1.5cm}{1.8cm}%
  540. {\vbox{\hbox{readable}
  541.        \hbox{output}}
  542. }%
  543. $$
  544.  
  545. This means that we don't see our output in its final form when it
  546. is being typed at the terminal. But in this case a little
  547. patience is amply rewarded, for a large number of symbols not
  548. available in most word processing programs become available. In
  549. addition, the typesetting is done with more precision, and the
  550. input files are easily sent between different computers by
  551. electronic mail or on a magnetic medium.
  552.  
  553. Our focus will be on the first step, that is, creating the \TeX{}
  554. input file and then running the \TeX{} program to produce
  555. appropriate results.  There are two ways of running the \TeX{}
  556. program; it can be run in batch mode or interactively.  In
  557. batch mode you submit your \TeX{} input file to your computer;
  558. it then runs the \TeX{} program without further intervention and
  559. gives you the result when it is finished.  In interactive mode
  560. the program can stop and get further input from the user, that
  561. is, the user can interact with the program.  Using \TeX{}
  562. interactively allows some errors to be corrected by the user,
  563. while the \TeX{} program makes the corrections in batch mode as
  564. best it can. Interactive is the preferred mode, of course. All
  565. personal computer and many mainframe implementations are
  566. interactive.  On some mainframes, however, the only practical
  567. method of running \TeX{} is in batch mode.
  568.  
  569.  
  570. \subsection{From \TeX{} file to readable output, the big set up}
  571. \vskip\baselineskip
  572.  
  573. \def\OzTeX{O\kern-.03em z\kern-.15em\TeX}
  574.  
  575. \noindent
  576. NB: \OzTeX\ users should ignore this section and
  577. refer to the \OzTeX\ User Guide.
  578.  
  579. \bigskip
  580.  
  581. {\parskip = 0pt \noindent
  582. [Note from MD:
  583. {\sl This is the only system dependent section in the manual and
  584. may be replaced by a local guide. No reference is made to it
  585. outside of the section itself. The following local information
  586. should be included:
  587. \item{$\bullet$} What initial steps, if any, should be taken by the reader
  588. to permit the running of \TeX{} and your local device driver(s).
  589. \item{$\bullet$} How to run \TeX\null.
  590. \item{$\bullet$} How to read the log file.
  591. \item{$\bullet$} How to preview and/or print the dvi file.
  592.  
  593. The following sample is applicable here at the University of
  594. Manitoba.  We use a locally written editor (MANTES) on an
  595. Amdahl running MVS; I'm fairly certain that it's the worst possible case.}]
  596. }
  597.  
  598. In this section we'll see how to run \TeX{} at the University of
  599. Manitoba.  It is assumed that the reader is familiar with MANTES
  600. and can create text files using it.
  601.  
  602. First, there are several things that must be done {\bf one time
  603. only}. To start you must do the following (you type in the
  604. material that looks like typewriter type):
  605. \item{(1)} allocate the files that \TeX{} will use by typing the
  606. following lines (while in MANTES):
  607. \itemitem{}  C: {\tt alloc da=source.tex format=vb,256,6144}
  608. \itemitem{}  C: {\tt alloc da=dvi format=fb,1024,6144}
  609.  
  610. \item{(2)} Create a file called RUNTEX in your MANTES aggregate
  611. containing the following JCL:
  612.  
  613. \beginuser
  614. //        JOB  ,'RUN TEX'
  615. //        EXEC TEXC
  616. //SRC     DD DSN=<userid>.SOURCE.TEX,DISP=SHR
  617. //DVI     DD DSN=<userid>.DVI,DISP=OLD
  618. \enduser
  619.  
  620.  
  621. The name {\tt <userid>} is replaced by your own user id, of
  622. course. The use of upper case and the spaces must be followed
  623. exactly.
  624.  
  625. \item{(3)} Create a file called PRINTTEX in your MANTES aggregate
  626. containing the following JCL:
  627.  
  628. \beginuser
  629. //        JOB  ,'PRINT TEX'
  630. //        EXEC TEXP
  631. //DVIFILE DD DSN=<userid>.DVI,DISP=SHR
  632. \enduser
  633.  
  634.  
  635. Once you have completed these three steps, you are ready to run a
  636. \TeX{} job. The files you have created will allow you to produce
  637. about ten pages of ordinary text.
  638.  
  639. Here are the steps you use {\bf each time you run a job}.
  640.  
  641. \item{(1)} create a MANTES file containing your \TeX{} input.
  642. \item{(2)} save and submit your file using the commands
  643. \itemitem{} C: {\tt save f/l to da=source.tex noseq}
  644. \itemitem{} C: {\tt submit runtex}
  645. \item{(3)} when you get a message saying that your job is finished,
  646. enter the command
  647. \itemitem{} C: {\tt out <jobname>; list ttyout}
  648.  
  649. In this command, {\tt <jobname>} is replaced by your user id with
  650. a dollar sign appended.  This file listing will tell you of any
  651. errors that might have occurred.  It is an abbreviated version of
  652. what is called the ``log file''; we will use the term ``log
  653. file'' to refer to the ttyout file produced by \TeX\null.
  654.  
  655. If you want, you can check on the status of your job while it is
  656. executing by using the command
  657. \itemitem{} C: {\tt q <jobname>}
  658.  
  659. When you are finished looking at the log file, the command {\tt
  660. end scratch} will throw away the log file while the command {\tt
  661. end release} will send the log file to the printer, and it can
  662. then be picked up with your \TeX{} output.
  663.  
  664. \item{(4)} when your output from RUNTEX program is error free, \TeX{}
  665. will have created a legal DVI file.  To print it, use the
  666. command
  667. \itemitem{} C: {\tt submit printtex nohold}
  668.  
  669. As in (3), you can check on the status of your job while it is
  670. executing.
  671. \item{(5)} Pick up your output at the I/O window, sixth floor
  672. Engineering building.  It usually takes about twenty minutes for the
  673. output to be ready.  Ask for it by ``{\tt <jobname>}''.
  674.  
  675. The files created are large enough for running \TeX{} jobs of about
  676. 10 pages.  A job of that size will take about one second of CPU time
  677. to run through \TeX\null.  It will take about 15 seconds of CPU time to
  678. print 10 pages on the Xerox 8600 using the current device driver.
  679.  
  680. You can print your own copy of this manual using the command
  681. {\tt \%docu tex}. You can also find lots of other useful
  682. online information about \TeX{} by using {\tt \%texinfo}.
  683.  
  684. \subsection{Let's do it!}
  685.  
  686. So, from our viewpoint, the name of the game is to create the \TeX{}
  687. file that produces the right readable output. What does
  688. a \TeX{} file look like? It consists of characters from an
  689. ordinary terminal, that is, upper and lower case letters,
  690. numbers, and the usual punctuation and accent characters (these
  691. are the usual ASCII characters). Text, for the most part, is just
  692. typed normally. Special instructions usually start with one of a
  693. few special symbols such as {\tt \#} or {\tt \&} (these will be
  694. described in more detail later). Here is an example of a \TeX{}
  695. input file:
  696.  
  697. \beginuser
  698. Here is my first \\TeX\\ sentence.
  699. \\bye
  700. \enduser
  701. \toindex{TeX{} } \toindex{ }
  702.  
  703.  
  704. First note that the characters in this example look like
  705. typewriter type. We use these characters with all examples that
  706. are meant to be typed from the computer terminal. Second, note
  707. that the backslash appears three times in the text. We'll soon
  708. see that this is one of the special symbols mentioned
  709. previously, and it is used very frequently when making \TeX{}
  710. documents. Make a file containing this example. Use the \TeX{}
  711. program to make a DVI file and a device driver to see what you
  712. have produced. If all goes well, you'll have a single page with
  713. the following single sentence:
  714.  
  715. Here is my first \TeX\ sentence.
  716.  
  717.   There will also be a page number at the bottom of the page. If
  718. you've gotten this far, congratulations! Once you can produce one
  719. \TeX{} document, it's just a matter of time before you can do
  720. more complicated ones. Now let's compare what we typed in with
  721. what we got out. The straightforward words were just typed in
  722. normally, and \TeX{} set them in ordinary type. But the word ``\TeX'',
  723. which can't be typed in on a terminal because the letters
  724. aren't on the same line, is entered by using a word starting with
  725. a backslash, and \TeX{} made the proper interpretation. Most
  726. symbols that are not ordinary letters, numbers, or punctuation
  727. are typeset by entering a word starting with a backslash. If we
  728. look a little closer, we'll note that the word ``first'' is also
  729. changed.
  730. \TeXref{4}
  731. The first two letters have been joined together and there isn't
  732. a separate dot over the letter ``i''. This is standard
  733. typesetting practice: certain letter combinations are joined up
  734. to form what are called {\sl ligatures}. There is actually a good
  735. \aesthetic{} reason for this. Compare the first two letters of
  736. ``first'' and ``{f}irst'' to see the difference. We note that
  737. {\tt \\bye} appears in the input file with no corresponding word
  738. in the final copy.
  739. \toindex{bye}
  740. This a typesetting instruction that tells \TeX{} that the input
  741. is finished. We'll learn about lots of different typesetting
  742. instructions as we go along.
  743.  
  744. Let's look at the log file that was created when we ran \TeX
  745. \null. It may vary slightly at your site, but should look
  746. something like this:
  747. \beginuser
  748.    1.
  749.    2.  This is TeX, MVS Version 2.9 (no format preloaded)
  750.    3.   ** File  PLAIN.FMT <-- DD=FMTLIB MEM=PLAIN
  751.    4.
  752.    5.   ** File  SRC.TEX <-- DD=SRC
  753.    6.  (src.tex [1]
  754.    7.  Output written on DVI (1 page, 256 bytes).
  755.    8.  Transcript written on TEXLOG.
  756. \enduser
  757.  
  758.  
  759. This is the file that will contain any error messages. On line 6,
  760. {\tt (src.tex\ } indicated that \TeX{} has started reading that
  761. file. The appearance of {\tt [1]} indicates that page 1 has been
  762. processed. If there were errors on page 1, they would be listed
  763. at that point.
  764.  
  765. \vskip .5cm
  766. \exercise Add a second sentence to your original \TeX{} file to get:
  767. \beginuser
  768. Here is my first \\TeX\\ sentence.
  769. I was the one who typeset it!
  770. \\bye
  771. \enduser
  772.  
  773. Use \TeX{} and look at your output. Is the second sentence on a
  774. new line?
  775.  
  776.  
  777. \exercise Now add this line to the beginning of your file:
  778. \beginuser
  779. \\nopagenumbers
  780. \enduser
  781. \noindent
  782. Guess what will happen when you run the new file through
  783. \TeX\null.  Now try it and see what happens.
  784. \toindex{nopagenumbers}
  785.  
  786. \exercise Add three or four more sentences to your file.
  787. Use letters, numbers, periods, commas, question marks,
  788. and exclamation points, but don't use any other symbols.
  789.  
  790.  
  791. \exercise Leave a blank line and add some more sentences.
  792. You can now get new paragraphs.
  793. \medskip
  794.  
  795. We have now seen a major principle concerning the preparation of
  796. \TeX{} input files. The placement of the text on your computer
  797. terminal does not necessarily correspond to the placement of the
  798. text on your output. You can not, for example, add space between
  799. words in your output by adding spaces in your input file. Several
  800. consecutive spaces and one space will produce exactly the same
  801. output. As would be expected, a word at the end of one line will
  802. be separated from the first word of the following line. In fact,
  803. sometimes when working on a file that will be heavily edited, it
  804. is convenient to start each sentence on a separate line. Spaces
  805. at the beginning of a line, however, are always ignored.
  806.  
  807. \exercise Add the following sentence as a new paragraph, and then
  808. typeset it:
  809. \beginuser
  810. Congratulations! You received a grade of 100\% on your latest
  811. examination.
  812. \enduser
  813. \noindent
  814. The {\tt\%} sign is used for comments in your input file.
  815. Everything on a line following this symbol is ignored. Notice
  816. that even the space that normally separates the last word on one
  817. line from the first word on the next line is lost. Now put a
  818. backslash in front of the {\tt\%} sign to correct the
  819. sentence. \toindex{\$} \toindex{\%}
  820.  
  821. \exercise Add the following sentence as a new paragraph:
  822. \beginuser
  823. You owe me \$10.00 and it's about time you sent it to me!
  824. \enduser
  825. \noindent
  826. This will produce an error in your log file (if your
  827. implementation of \TeX{} is interactive, that is, sends you
  828. messages and waits for answers, just hit the carriage return or
  829. enter key when you get the error message). You will get output,
  830. but not what you might expect. Look at the log file and see
  831. where the error messages are listed. Don't worry about the
  832. actual messages. We'll have a lot more to say about errors
  833. (including this one) later. Now fix the error by putting a
  834. backslash in front of the {\tt \$} sign, and typeset the result
  835. (there are a small number of characters like the per cent and
  836. dollar signs that \TeX{} uses for its own purposes. A table of
  837. these characters will be provided shortly).
  838.  
  839. \subsection{\TeX{} has everything under control}
  840.  
  841. We have seen that the backslash has a special role. Any word
  842. starting with a backslash will be given a special interpretation
  843. when \TeX{} reads it from your input file. Such a word is called
  844. a {\sl control sequence}. There are, in fact, two types of
  845. control sequences: a {\sl control word\/} is a backslash followed
  846. by letters only (for example, {\tt \\TeX}) and a {\sl control
  847. symbol\/} is a backslash followed by a single nonletter (for
  848. example, {\tt \\\$})\null. Since a space is a nonletter, a
  849. backslash followed by a space is a legitimate control symbol.
  850. \TeXref{7--8}
  851. When we want to emphasize that a space is present, we will use a
  852. special symbol {\tt\sp} to indicate the space, as in the control
  853. symbol {\tt\\\sp}.  This convention is used in {\bf The \TeX
  854. book} as well as in this manual.
  855.  
  856. When \TeX{} is reading your input file and comes to a backslash
  857. followed by a letter, it knows that a control word is being
  858. read. So it continues reading the name of the control word until
  859. a nonletter is read. So if your file contains
  860.  
  861. \displaytext{\tt I like \\TeX!}
  862.  
  863. \noindent
  864. the control word {\tt \\TeX} is terminated by the exclamation
  865. point. But this presents a problem if you want to have a space
  866. after a control word. If you have, for example, the sentence
  867.  
  868. \displaytext{\tt I like \\TeX and use it all the time.}
  869.  
  870. \noindent
  871. in your input file, the control word {\tt\\TeX} is terminated by
  872. the space (which is, of course, a nonletter). But then you won't
  873. have a space between the words ``\TeX{}'' and ``and''; inserting
  874. more spaces won't help, since \TeX{} doesn't distinguish between
  875. one space and several consecutive spaces. But if you put the
  876. control symbol {\tt\\\sp} after a control word, you will both
  877. terminate the control word and insert a space. It's really easy
  878. to forget to put in something like {\tt\\\sp} after a control
  879. word. I promise you that you will do it at least once while
  880. you're learning to use \TeX\null.
  881.  
  882. \exercise Make an input file that will produce the following
  883. paragraph:
  884.  
  885. I like \TeX! Once you get the hang of it, \TeX{} is really easy
  886. to use. You just have to master the \TeX nical aspects.
  887.  
  888. Most control words are named so as to give a hint of their uses.
  889. You can use {\tt \\par} to make a new paragraph, for example,
  890. instead of putting in a blank line.
  891. \toindex{par}
  892.  
  893. \subsection{What \TeX{} won't do}
  894.  
  895. \TeX{} is very good at setting type, but there are things that \TeX{}
  896. can't do well.  One is making figures.  Space can be left
  897. to insert figures, but there are no graphic procedures built into
  898. the language (at present).  Some implementations allow graphic
  899. instructions to be inserted using the {\tt \\special} control
  900. word but these are exceptional and definitely site dependent.
  901.  
  902. \TeX{} sets type in horizontal straight lines and not in
  903. straight lines at other angles. In particular, it is generally
  904. not possible to make insertions in ``landscape mode'', that is,
  905. with the text rotated by so that the baseline is parallel with
  906. the long edge of the paper, or to include text that has a curve for
  907. a baseline. Perspective type (gradually increasing or
  908. decreasing in height) is not handled well by \TeX\null.
  909.  
  910. We have seen that there is an ``edit, \TeX{}, driver'' cycle that
  911. is necessary for each different copy of output.  This is true
  912. even when the output device is a terminal.  In particular, it's
  913. not possible to type the input file and see the results on the
  914. screen immediately without going through the full cycle.  Some
  915. implementations have both text and graphics displays with
  916. reasonably quick turnaround (a few seconds for a single page); as
  917. hardware becomes less expensive and processors become faster, we
  918. may see improvement.
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925. \section{All characters great and small}
  926.  
  927. \subsection{Some characters are more special than others}
  928.  
  929. We saw in the last section that most text is entered at the
  930. terminal as sentences of ordinary words just as when typing with
  931. a typewriter. But we also saw that, in particular, the backslash
  932. could be used for at least two different purposes. It can be
  933. used for symbols (or combinations of symbols) that don't appear
  934. on the keyboard such as typing {\tt \\TeX} to get \TeX\null. It
  935. can also be used to give \TeX{} special instructions such as
  936. typing {\tt \\bye} to indicate the end of the input file. In
  937. general, a word starting with a backslash will be interpreted by
  938. \TeX{} as one requiring special attention. There are several
  939. hundred words that \TeX{} knows, and you can define more
  940. yourself, and so the backslash is very important. We'll spend a
  941. lot of time as we proceed learning some of these words;
  942. fortunately we'll only need to use a small number of them most of
  943. the time.
  944.  
  945. There are ten characters which, like the backslash, are used
  946. by \TeX{} for special purposes, and we now want to give the
  947. complete list.
  948. \TeXref{37--38}What if we want to use a sentence with one of these
  949. special characters in it? With this in mind we'll ask the following
  950. questions:
  951. \item{(1)} What are the different special characters?
  952. \item{(2)} How do we use a special character if we really want to
  953. typeset it in our text?
  954.  
  955. Here is a table of each special character, its purpose, and the
  956. method of typesetting the special character itself if you need
  957. it:
  958.  
  959.  
  960. \maketable [Characters requiring special input]
  961. \halign{
  962.    \strut \hfil#\hfil & \quad # \hfil & \quad\tt # \hfil\cr
  963.    \bf Character & \bf Purpose & \bf Input for literal output \cr
  964.    \noalign{\hrule} \noalign{\smallskip}
  965.    $\backslash$   & Special symbols and instructions & \$\\backslash\$   \cr
  966.    $\{$ & Open group                       & \$\\\lb\$    \cr
  967.    $\}$ & Close group                      & \$\\\rb\$    \cr
  968.    \%   & Comments                         & \\\%         \cr
  969.    \&   & Tabs and table alignments        & \\\&         \cr
  970.    \~{} & Unbreakable space                & \\\~{}\lb\rb \cr
  971.    \$   & Starting or ending math text     & \\\$         \cr
  972.    \^{} & Math superscripts                & \\\^{}\lb\rb \cr
  973.    \_{} & Math subscripts                  & \\\_{}\lb\rb \cr
  974.    \#   & Defining replacement symbols     & \\\#         \cr
  975.        }
  976.  
  977. \toindex{\lb}
  978. \toindex{\rb}
  979. \toindex{\%}
  980. \toindex{\&}
  981. \toindex{\~{}}
  982. \toindex{\$}
  983. \toindex{\^{}}
  984. \toindex{\_{}}
  985. \toindex{\#}
  986.  
  987. \subsection{Typesetting with an accent}
  988.  
  989. Now we're going to start using some of \TeX{}'s goodies! So far
  990. we've just been using \TeX{} to make our output look attractive,
  991. but now we'll start to do things that are difficult or impossible
  992. on the typewriter. In particular, we're going to look at accents
  993. now. How do you produce an accent when the symbol doesn't appear on
  994. the keyboard? Just as with the symbol \TeX{}, it is necessary to
  995. enter a word starting with a backslash. For the word ``premi\`ere'',
  996. as a first example, you need to type in {\tt premi\\`ere}
  997. (you may have to hunt around to find the ``back prime''
  998. or ``grave'' symbol {\tt `} on your keyboard, but it's there
  999. somewhere\fnote{If you have a very old or obscure
  1000. keyboard and the back prime is {\it really\/} not there, you can
  1001. use {\tt \\lq\lb\rb} instead.  Similarly {\tt \\rq\lb\rb} can be
  1002. used for the symbol {\tt '}. You can think of the symbols as
  1003. being abbreviations for ``left quote'' and ``right quote.'' In
  1004. addition, {\tt \\lq\\lq\lb\rb} and {\tt \\rq\\rq\lb\rb} give the
  1005. usual quotation marks. But this won't work as a method to produce
  1006. an accent over the following letter, so you're really better off
  1007. with a proper keyboard.}). In general, to put an accent
  1008. on a letter, the appropriate control sequence precedes the letter.
  1009.  
  1010. Here are some examples:
  1011. $$\vbox{
  1012.  
  1013. \halign{
  1014. \strut \hfil\tt # & \quad # \hfil\cr
  1015. \bf \TeX{} input & \bf \TeX{} output \cr
  1016. \noalign{\hrule} \noalign{\smallskip}
  1017. \\`a la mode          & \`a la mode \cr
  1018. r\\'esum\\'e          & r\'esum\'e  \cr
  1019. soup\\c{\sp}con   & soup\c con  \cr
  1020. No\\"el               & No\"el      \cr
  1021. na\\"\\i{\sp}ve    & na\"\i ve   \cr
  1022. }
  1023. }$$
  1024.  
  1025.  
  1026. We see several principles illustrated by these examples. Most
  1027. accents are produced by using a control symbol with a similar
  1028. shape. A few of them are produced by control words containing a
  1029. single letter. Some care must be used in this case, for a space
  1030. must be used to terminate the control word. If you have {\tt
  1031. soup\\ccon} in your file, for example, \TeX{} will look for the
  1032. control word {\tt\\ccon}\fnote{We'll see that there is another
  1033. method when we look at the grouping concept in Section~4.}.
  1034. \TeXref{52--53}
  1035.  
  1036. Notice that there is a control word {\tt\\i} also. This produces
  1037. the letter ``i'' without the dot over it; this allows an accent
  1038. to be put over the lower part of the letter. There is an
  1039. analogous control word {\tt\\j} that produces a dotless ``j''
  1040. for accenting purposes.
  1041.  
  1042. \maketable [Accents that may be immediately followed by a letter]
  1043. \halign{
  1044.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1045.    \bf Name & \bf \TeX{} input & \bf \TeX{} output \cr
  1046.    \noalign{\hrule} \noalign{\smallskip}
  1047.    grave           & \\`o & \`o \cr
  1048.    acute           & \\'o & \'o \cr
  1049.    circumflex      & \\\^{}o & \^o \cr
  1050.    umlaut/dieresis/tr\'emat & \\"{}o    & \"o \cr
  1051.    tilde           & \\\~{}o & \~o \cr
  1052.    macron          & \\={}o    & \=o \cr
  1053.    dot             & \\\char'056{}o    & \.o \cr
  1054.        }
  1055.  
  1056. \toindex{`}
  1057. \toindex{'}
  1058. \toindex{\^{}}
  1059. \toindex{"}
  1060. \toindex{i}
  1061. \toindex{j}
  1062. \toindex{=}
  1063. \toindex{.}
  1064.  
  1065. \maketable [Accents requiring an intervening space]
  1066. \halign{
  1067.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1068.    \bf Name & \bf \TeX{} input & \bf \TeX{} output \cr
  1069.    \noalign{\hrule} \noalign{\smallskip}
  1070.    cedilla         & \\c o   & \c{o} \cr
  1071.    underdot        & \\d o   & \d{o} \cr
  1072.    underbar        & \\b o   & \b{o} \cr
  1073.    h\'a\v{c}ek     & \\v o   & \v{o} \cr
  1074.    breve           & \\u o   & \u{o} \cr
  1075.    tie             & \\t oo  & \t oo \cr
  1076.    Hungarian umlaut& \\H o   & \H{o} \cr
  1077.       }
  1078.  
  1079. \toindex{c}
  1080. \toindex{d}
  1081. \toindex{b}
  1082. \toindex{v}
  1083. \toindex{u}
  1084. \toindex{t}
  1085. \toindex{H}
  1086.  
  1087. \TeX{} also allows some letters from languages other than English to
  1088. be typeset.
  1089.  
  1090. \maketable [A\kern-1pt vailable foreign language symbols]
  1091. \halign{
  1092.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1093.    \bf Example& \bf \TeX{} input & \bf \TeX{} output \cr
  1094.    \noalign{\hrule} \noalign{\smallskip}
  1095.    \AE gean, \ae sthetics     & \\AE, \\ae    & \AE, \ae \cr
  1096.    \OE uvres, hors d'\oe uvre & \\OE \\oe     & \OE, \oe \cr
  1097.    \AA ngstrom                & \\AA, \\aa    & \AA, \aa \cr
  1098.    \O re, K\o benhavn         & \\O, \\o      & \O, \o   \cr
  1099.    \L odz, \l\'odka           & \\L, \\l      & \L, \l   \cr
  1100.    Nu\ss                      & \\ss          & \ss      \cr
  1101.    ?`Si?                      & {?}{`}        & ?`       \cr
  1102.    !`Si!                      & {!}{`}        & !`       \cr
  1103.    Se\~nor                    & \\\~{}        & \~{}       \cr
  1104.                              & \lb\\it\\\$\rb & {\it\$}  \cr
  1105.       }
  1106.  
  1107. \toindex{AE}
  1108. \toindex{ae}
  1109. \toindex{OE}
  1110. \toindex{oe}
  1111. \toindex{AA}
  1112. \toindex{aa}
  1113. \toindex{O}
  1114. \toindex{o}
  1115. \toindex{L}
  1116. \toindex{l}
  1117. \toindex{ss}
  1118.  
  1119. Typeset the sentence in each of the following exercises:
  1120.  
  1121. \exercise Does \AE schylus understand \OE dipus?
  1122.  
  1123. \exercise The smallest internal unit of \TeX{} is about 53.63\AA.
  1124.  
  1125. \exercise They took some honey and plenty of money wrapped up in a
  1126. {\it \$}5 note.
  1127.  
  1128. \exercise \'El\`eves, refusez vos le\c cons! Jetez vos cha\^\i nes!
  1129.  
  1130. \exercise Za\v sto tako polako pijete \v caj?
  1131.  
  1132. \exercise Mein Tee ist hei\ss.
  1133.  
  1134. \exercise Peut-\^etre qu'il pr\'ef\`ere le caf\'e glac\'e.
  1135.  
  1136. \exercise ?`Por qu\'e no bebes vino blanco? !`Porque est\'a avinagrado!
  1137.  
  1138. \exercise M\'\i\'\j n idee\"en worden niet be\"\i nvloed.
  1139.  
  1140. \exercise Can you take a ferry from \"Oland to \AA land?
  1141.  
  1142. \exercise T\"urk\c ce konu\c san ye\u genler nasillar?
  1143.  
  1144.  
  1145. \def\bdots{$\textfont0=\tenbf \ldots$} %%% boldface version of \ldots
  1146.  
  1147. \subsection{Dots, dashes, quotes, \bdots}
  1148.  
  1149. Typing has always been a compromise: the small number of keys
  1150. (compared to the number of typeset symbols available) has forced
  1151. some changes on the typist.  When preparing material using \TeX{},
  1152. there is no need to be so restricted. In this section we'll look
  1153. at some differences between typing and using \TeX\null.
  1154.  
  1155. There are four types of dashes that are used.  The hyphen is used
  1156. for combining words into one unit as with mother-in-law.
  1157. \TeXref{3--5}
  1158. The en-dash is used to indicate a sequence of page numbers, years
  1159. or such things. The em-dash is a grammatical symbol.  The minus
  1160. sign is used for negative numbers. Here they are with their uses:
  1161.  
  1162. \maketable [Different types of dashes]
  1163. \halign{
  1164.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil
  1165.                         & \hfil # \hfil\cr
  1166.    \bf Name& \bf \TeX{} input & \bf \TeX{} output & \bf Example\cr
  1167.    \noalign{\hrule} \noalign{\smallskip}
  1168.    hyphen     & -         & -   & The space is 3-dimensional. \cr
  1169.    en-dash    & {-}{-}    & --  & Read pages 3--4. \cr
  1170.    em-dash    & {-}{-}{-} & --- & I saw them---there were 3 men alive. \cr
  1171.    minus sign & \$-\$     & $-$ & The temperature dropped to $-$3 degrees. \cr
  1172.       }
  1173.  
  1174. \exercise I entered the room and---horrors---I saw both my
  1175. father-in-law and my mother-in-law.
  1176.  
  1177. \exercise The winter of 1484--1485 was one of discontent.
  1178. \bigskip
  1179.  
  1180.  
  1181. Another difference between typing and using \TeX{} is the use of
  1182. quotation marks.  Opening and closing quotation marks are the
  1183. same on a typewriter.  They are produced in \TeX{} by using the
  1184. apostrophe or prime key {\tt '} and backprime key {\tt `}\null.
  1185. An open quote is produced by {\tt ``} and the
  1186. close quote by {\tt ''}\null.\TeXref{3} Similarly the
  1187. opening single quote is produced by {\tt `} and the closing
  1188. single quote by {\tt '}\null. Notice that there is no need
  1189. to use the usual typing quotation mark (it normally gives a close
  1190. quote, but don't count on it).
  1191.  
  1192. \exercise His ``thoughtfulness'' was impressive.
  1193.  
  1194. \exercise Frank wondered, ``Is this a girl that can't say `No!'?''
  1195. \bigskip
  1196.  
  1197. Sometimes ellipses (three dots) are used to indicate a passage
  1198. of time or missing material.  Typing three periods will give
  1199. three dots very close together. The dots with proper spacing will
  1200. be produced by having {\tt \\dots} in your input file.
  1201. \TeXref{173}
  1202. \toindex{dots}
  1203.  
  1204. \exercise He thought, ``\dots and this goes on forever, perhaps to the
  1205. last recorded syllable.''
  1206.  
  1207. Another problem with dots is that the period after an
  1208. abbreviation normally has less space after it than does the
  1209. period at the end of a sentence. There are two ways to solve this
  1210. problem: the dot can be followed by either {\tt\\\sp} or {\tt\~{}}
  1211. to change the spacing.
  1212. \TeXref{91--92}
  1213. The second alternative will give an unbreakable space; when such
  1214. a space is between two words, these words must typeset on the
  1215. same line. The input {\tt Prof.\~{}Knuth} would cause those two
  1216. words to be typeset on one line.  This is desirable for names
  1217. like Vancouver, B.~C. and Mr.~Jones so that ``Mr.'' and ``Jones''
  1218. do not end up on separate lines. Notice that no backslash is used
  1219. with the unbreakable space.
  1220.  
  1221. \exercise Have you seen Ms.~Jones?
  1222.  
  1223. \exercise Prof.~Smith and Dr.~Gold flew from
  1224. \ifcanspell
  1225. Halifax N.~S. to Montr\'eal, P.~Q. via Moncton, N.~B.
  1226. \else
  1227. L.~A. to Washington, D.~C., via Fargo, N.~D.
  1228. \fi
  1229.  
  1230.  
  1231. \subsection{Different fonts}
  1232.  
  1233. The most obvious difference between typewritten text and \TeX{}
  1234. output is undoubtedly the different fonts or types of symbols
  1235. used. When \TeX{} starts up it has sixteen fonts available.  Some
  1236. of these are used for technical purposes, but even so there are
  1237. several different typefaces available as can be seen in the
  1238. following table. A complete list of the sixteen fonts is given in
  1239. Appendix F of {\bf The \TeX{}book}.
  1240. \TeXref{427--432}
  1241. Most of them are used automatically; a mathematical subscript,
  1242. for example, is put in smaller type by \TeX{} with no special
  1243. user intervention.
  1244.  
  1245. To change from the usual (roman) typeface to italic, the control
  1246. word {\tt \\it} is used.  To change back to the usual roman
  1247. typeface, use {\tt \\rm}. For example, you could have the
  1248. following sentence: {\tt I started with roman type, \\it switched
  1249. to italic type, \\rm and returned to roman type}. This would give
  1250. the following: I started with roman type, \it switched to italic
  1251. type,\fnote{Notice that the comma and this footnote are in
  1252. italic type, and this looks a little funny. We'll see that there
  1253. is another method for changing fonts when we talk about grouping
  1254. in Section 4.}
  1255. \rm and returned to roman type.
  1256.  
  1257. Typefaces other than italic are also available. Those given below
  1258. are the ones most commonly used.  They are available immediately
  1259. when \TeX{} starts. A little later we'll see how to use other
  1260. typefaces that aren't available when \TeX{} starts.
  1261.  
  1262. \global\advance\footnotenum by 1
  1263. \maketable [Font Samples]
  1264. \halign{
  1265.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1266.    \bf Font name & \bf \TeX{} switch sequence & \bf Sample of typeface \cr
  1267.    \noalign{\hrule} \noalign{\smallskip}
  1268.    Roman       & \\rm  & \rm This is roman type. \cr
  1269.    Boldface    & \\bf  & \bf This is boldface type. \cr
  1270.    Italic      & \\it  & \it This is italic type. \cr
  1271.    Slanted     & \\sl  & \sl This is slanted type. \cr
  1272.    Typewriter  & \\tt  & \tt This is typewriter type. \cr
  1273.    Math symbol${}^\the\footnotenum$ & \\cal & $\cal SOME\hbox{\quad}SCRIPT
  1274.                                      \hbox{\quad}LETTERS$\rm. \cr
  1275.       }
  1276.  
  1277. \footnote{}{\llap{$^\the\footnotenum$}%
  1278. This example is cheating since you need to know a little about
  1279. mathematics input to use it, but I wanted to include it anyway.
  1280. You'll be able to use these letters after you study the use of
  1281. mathematical symbols.}
  1282. \nobreak
  1283. \toindex{it}
  1284. \toindex{rm}
  1285. \toindex{bf}
  1286. \toindex{sl}
  1287. \toindex{tt}
  1288.  
  1289. The slanted and italic fonts seem quite similar at first.  It is
  1290. easy to see the difference between the letter ``a'' in each
  1291. sample. When changing from a slanted or italic font to a roman
  1292. font, the last letter in the first font will lean towards the
  1293. first letter of the roman font; this looks cramped, and to
  1294. compensate there is a little extra space that can be added called
  1295. the {\sl italic correction}. This is done using the control
  1296. symbol {\tt \\/}.
  1297. \toindex{/}
  1298. In the following sentence, there is no italic correction after
  1299. the first sequence of italic letters but there is after the
  1300. second sequence; see the difference: {\it If} the italic
  1301. correction is not used the letters are too close together, but
  1302. {\it if\/} the correction is used, the spacing is better.  There
  1303. is no need for the italic correction when the italic characters
  1304. are followed by a comma or a period, but your text will
  1305. definitely look better if you use it before quotation marks or
  1306. parentheses.
  1307.  
  1308.  
  1309. It is possible to use fonts other than those initially defined in
  1310. \TeX{} when desired (assuming that they are available on
  1311. your computer system, of course).  Different sizes can be used
  1312. with the aid of the control word {\tt \\magstep}. To define your
  1313. new font you will have to know its name on your computer system.
  1314. For example, the roman typeface is called ``cmr10'' on most
  1315. systems.  If you use {\tt \\font\\bigrm = cmr10 scaled \\magstep
  1316. 1}, you can then use {\tt\\bigrm} in exactly the same way as you
  1317. use {\tt\\it} or {\tt\\rm}.
  1318. \TeXref{13--17}
  1319. \toindex{magstep}
  1320. \toindex{font}
  1321. \toindex{scaled}
  1322.  
  1323. Switching via {\tt\\bigrm} will give roman type that is larger
  1324. than the usual by 20\%\null.  {\tt \\font\\bigbigrm = cmr10
  1325. scaled \\magstep 2} will define a font that is about 44\% larger
  1326. than the usual roman typeface.  The sizes {\tt \\magstep~0} to
  1327. {\tt \\magstep~5} are available.  On most computers {\tt \\magstephalf}
  1328. is also available; this represents an enlargement of
  1329. about 9.5\%\null. Here are some samples at various sizes:
  1330.  
  1331. \maketable [Different Font Magnifications]
  1332. \halign{
  1333.    \strut \tt # \hfil & \quad # \hfil \cr
  1334.    \bf Magnification & \bf Sample \cr
  1335.    \noalign{\hrule} \noalign{\smallskip}
  1336.    \\magstep 0     & \rm  Sample text at magstep 0. \cr
  1337.    \\magstephalf   & \halfrm  Sample text at magstephalf. \cr
  1338.    \\magstep 1     & \brm  Sample text at magstep 1. \cr
  1339.    \\magstep 2     & \bbrm  Sample text at magstep 2. \cr
  1340.    \\magstep 3     & \bbbrm  Sample text at magstep 3. \cr
  1341.    \\magstep 4     & \bbbbrm  Sample text at magstep 4. \cr
  1342.    \\magstep 5     & \bbbbbrm  Sample text at magstep 5. \cr
  1343.       }
  1344. \bigskip
  1345.  
  1346. It's also possible to use completely new typefaces.  These
  1347. are dependent on system availability, of course.  Many systems
  1348. have a file called CMSS10 which is a font that contains sans
  1349. serif letters.  Using {\tt \\font\\sf = cmss10} will allow the
  1350. control word {\tt\\sf} to be used in the same manner as {\tt\\bf}.
  1351. Having made this definition, the input
  1352. \displaytext{\tt \\sf Here is a sample of our new Sans Serif font.}
  1353. will produce
  1354. \displaytext{\sf Here is a sample of our new Sans Serif font.}
  1355.  
  1356. \exercise What problem might have arisen if we had used {\tt \\ss}
  1357. instead of {\tt \\sf} to turn on the Sans Serif font? Hint: if
  1358. the answer doesn't occur to you at first, think about the German
  1359. alphabet and it will finally come to you.
  1360.  
  1361. \exercise Typeset a paragraph of magnified sans serif text.
  1362.  
  1363. The extra fonts available may vary from site to site.  The ones
  1364. in the following table are available at most places.
  1365.  
  1366. \maketable [External Fonts Names]
  1367. \halign{
  1368. \strut \tt # \hfil & \quad \tt # \hfil & \quad \tt # \hfil
  1369.                    & \quad \tt # \hfil & \quad \tt # \hfil
  1370.                    & \quad \tt # \hfil  \cr
  1371. \noalign{\hrule} \noalign{\smallskip}
  1372. CMBSY10   &CMBXSL10  &CMBXTI10  &CMBX10    &CMBX12    &CMBX5      \cr
  1373. CMBX6     &CMBX7     &CMBX8     &CMBX9     &CMB10     &CMCSC10    \cr
  1374. CMDUNH10  &CMEX10    &CMFF10    &CMFIB8    &CMFI10    &CMITT10    \cr
  1375. CMMIB10   &CMMI10    &CMMI12    &CMMI5     &CMMI6     &CMMI7      \cr
  1376. CMMI8     &CMMI9     &CMR10     &CMR12     &CMR17     &CMR5       \cr
  1377. CMR6      &CMR7      &CMR8      &CMR9      &CMSLTT10  &CMSL10     \cr
  1378. CMSL12    &CMSL8     &CMSL9     &CMSSBX10  &CMSSDC10  &CMSSI10    \cr
  1379. CMSSI12   &CMSSI17   &CMSSI8    &CMSSI9    &CMSSQI8   &CMSSQ8     \cr
  1380. CMSS10    &CMSS12    &CMSS17    &CMSS8     &CMSS9     &CMSY10     \cr
  1381. CMSY5     &CMSY6     &CMSY7     &CMSY8     &CMSY9     &CMTCSC10   \cr
  1382. CMTEX10   &CMTEX8    &CMTEX9    &CMTI10    &CMTI12    &CMTI7      \cr
  1383. CMTI8     &CMTI9     &CMTT10    &CMTT12    &CMTT8     &CMTT9      \cr
  1384. CMU10     &CMVTT10                                                \cr
  1385. }
  1386. \bigskip
  1387.  
  1388. Here's a little background about these names.  The first two
  1389. letters {\tt CM} stands for Computer Modern, the name given to
  1390. this font family by the designer. The number at the end is the
  1391. point size: 10 point type is the normal size, 7 point is the
  1392. normal size for subscripts, and 5 point is the normal size for
  1393. subscripts of subscripts, 12 point is 20\% larger than 10 point,
  1394. etc. If the letters {\tt CM} are followed by {\tt B}, it is a
  1395. boldface type.  Similarly {\tt R} indicates roman, {\tt I} is for
  1396. italics, {\tt CSC} is for small caps, {\tt SL} is for slanted,
  1397. {\tt SS} is for sans serif, {\tt SY} is for symbols,
  1398. and {\tt TT} is for typewriter type.
  1399.  
  1400. \exercise Find the fonts available on your system, and print out
  1401. all the letters and numbers in several of them.
  1402.  
  1403. \exercise The font {\tt CMR12} is 20\% larger than {\tt CMR10}.
  1404. Also {\tt \\magstep~1} magnifies the type by 20\%.  Take some
  1405. text and print it using {\tt CMR12} then using {\tt CMR10} scaled
  1406. by {\tt \\magstep~1}. The results are quite different!
  1407.  
  1408.  
  1409.  
  1410.  
  1411. \section{The shape of things to come}
  1412.  
  1413. In this section we want to see how to make text have different
  1414. shapes or sizes.  One may use \TeX{} with the default sizes, of
  1415. course, just as we have been doing so far.  We'll now become more
  1416. creative with our output.  In discussing the size of various
  1417. parts of a page of text, there are several units of measure we
  1418. can use.
  1419.  
  1420. \subsection{Units, units, units}
  1421.  
  1422. \TeX{} can measure length using many types of units.  The most
  1423. common are the inch, the \centimeter, the point, the pica. The
  1424. abbreviations for these units are {\tt in}, {\tt cm}, {\tt pt},
  1425. and {\tt pc} respectively. The point is defined by the equation 1
  1426. inch = 72.27 points, and the pica by 1 pica = 12 points. Thus a
  1427. point is rather small and is about the size of a decimal point.
  1428. Here is a sample to give an idea of the comparative sizes:
  1429. \def\pip{\vrule height 4 true pt }
  1430. \TeXref{57}
  1431.  
  1432. $$ \hbox{1 inch: } \hbox to 1 true in{\pip\hrulefill\pip}$$
  1433. $$ \hbox{1 \centimeter: }\hbox to 1 true cm{\pip\hrulefill\pip}$$
  1434. $$ \hbox{20 points: }\hbox to 20 true pt{\pip\hrulefill\pip}$$
  1435. $$ \hbox{1 pica: } \hbox to 1 true pc{\pip\hrulefill\pip}$$
  1436.  
  1437. Thus points are used to make fine changes; a pica is about the
  1438. distance between the baselines of two consecutive lines of
  1439. (unmagnified) normal text.  \TeX{} is quite exact about
  1440. dimensions; internally its smallest unit is less than one
  1441. four-millionth of an inch.  Hence it is the resolution of the
  1442. output device that will determine the accuracy of the output.
  1443.  
  1444. There are two other units that are sometimes useful that have
  1445. different sizes in different fonts. The {\tt ex} is about the
  1446. height of a small ``x'' and the {\tt em} is a little smaller than
  1447. the width of a capital ``M''\null.
  1448. \TeXref{60}
  1449.  
  1450. The shape of the output is generally determined by control
  1451. words. There are many such words; these allow very fine control
  1452. of the resulting text.  But most of the time only a small number
  1453. of them are necessary.
  1454.  
  1455. \subsection{Page shape}
  1456.  
  1457. The text on a page consists of three basic parts.  There is the
  1458. headline above the main text; this often contains a chapter
  1459. title, section title, or a page number, and may differ on odd and
  1460. even pages. Below this is the main text, which includes any
  1461. footnotes. And finally there is the footline that might contain a
  1462. page number.
  1463.  
  1464. In the examples we have seen so far, the headline has been blank.
  1465. The footline has contained either a \centred{} number or, if {\tt
  1466. \\nopagenumbers} had been used, has also been blank.  We'll have
  1467. more to say about headlines and footlines later in this section.
  1468. For the moment let's concentrate on the main text.
  1469.  
  1470. To finish one page and start a new one, {\tt \\vfill \\eject} can
  1471. be used.  The control word {\tt \\eject} forces the completion of
  1472. the current page, while {\tt \\vfill} causes any left over
  1473. vertical space to be gathered at the bottom of the page (you might
  1474. try leaving out the {\tt \\vfill} as an experiment to see how the
  1475. vertical \analog{} of justified horizontal lines of text works).
  1476. \toindex{vfill}
  1477. \toindex{eject}
  1478.  
  1479.  
  1480. {\hsize=4in
  1481. The current horizontal width of the text on the page is described
  1482. by the control word {\tt \\hsize}.  It can be changed, say to 4
  1483. inches, by {\tt \\hsize = 4 in\ } at any desired time using
  1484. methods to be described in the next few sections. The value of
  1485. {\tt \\hsize} in effect when the paragraph is completed
  1486. determines the width of the paragraph. As can be seen in this
  1487. paragraph, the text width can be changed (in this case to 4
  1488. inches) for a single paragraph.  Because it represents the
  1489. current value of the horizontal width, expressions such as {\tt
  1490.  \\hsize = 0.75\\hsize} can make a new value that is relative
  1491. to the old one. \par}
  1492. \toindex{hsize}
  1493.  
  1494. The vertical \analog{} of {\tt \\hsize} is {\tt \\vsize}, which
  1495. is the current height of the main text.  It can be reset, just
  1496. like {\tt \\hsize}.  Thus, {\tt \\vsize = 8 in\ } can be used to
  1497. change the vertical height of the main text. Note that {\tt \\vsize}
  1498. is the size of the text exclusive of any headline or
  1499. footline material.
  1500. \toindex{vsize}
  1501.  
  1502. Text can also be shifted across the page.  The upper left corner
  1503. of the text is one inch down and one inch in from the upper left
  1504. corner of the page.  The control words {\tt \\hoffset} and {\tt \\voffset}
  1505. are used to shift the text horizontally and
  1506. vertically.  Thus {\tt \\hoffset = .75 in} and {\tt \\voffset =
  1507. -.5 in} would shift the text an additional .75 inches to the
  1508. right and .5 inches up. Most of the time you'll need to set {\tt
  1509. \\hoffset}, {\tt \\voffset}, and {\tt \\vsize} at the beginning
  1510. of your document only.
  1511. \TeXref{251}
  1512. \toindex{hoffset}
  1513. \toindex{voffset}
  1514.  
  1515. \global\advance\footnotenum by 1
  1516. \maketable [Control words for page sizes]
  1517. \halign{
  1518.    \strut \hfil # & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1519.    \bf Name & \bf \TeX{} Control Word & \bf \TeX{} default value (inches)\cr
  1520.    \noalign{\hrule} \noalign{\smallskip}
  1521.    horizontal width  & \\hsize   & 6.5 \cr
  1522.    vertical width    & \\vsize   & 8.9 \cr
  1523.    horizontal offset${}^\the\footnotenum$  & \\hoffset & 0 \cr
  1524.    vertical offset${}^\the\footnotenum$   & \\voffset & 0 \cr
  1525.       }
  1526.  
  1527. \footnote{}{\llap{$^\the\footnotenum$}The text is initially 1 inch
  1528. down and 1 inch in from upper left corner of the page.}
  1529. \nobreak
  1530.  
  1531. \exercise Enter a paragraph of text that is a few lines long.
  1532. Take several copies of your paragraph and put {\tt \\hsize = 5
  1533. in\ } before one and {\tt \\hsize = 10 cm\ } in front of a second
  1534. one.  Try a few other values for {\tt \\hsize}.
  1535.  
  1536. \exercise Put {\tt \\hoffset = .5 in\ } and {\tt \\voffset = 1
  1537. in\ } before the first paragraph of your previous exercise.
  1538.  
  1539. \exercise Take your previous exercise and put {\tt \\vsize = 2
  1540. in\ } before the first paragraph.
  1541. \bigskip
  1542.  
  1543. In the previous section we saw that it is possible to use fonts
  1544. of larger size by using the {\tt \\magstep} control word.  It's
  1545. also possible to magnify the entire document at once. If {\tt
  1546. \\magnification = \\magstep 1} appears at the top of your document,
  1547. then all of your output is magnified by 20\%\null.  The other
  1548. values of {\tt \\magstep} can be used, too. {\bf It should be
  1549. emphasized that {\tt \\magnification} can only be used before
  1550. even a single character is typeset.}  This magnification creates
  1551. a problem in units; if the document is to be magnified by 20\%
  1552. and {\tt \\hsize = 5 in} appears in the \TeX{} input file, should
  1553. the final output have an {\tt \\hsize} of 5 inches or should it
  1554. be magnified by 20\% to 6 inches? Unless told otherwise, all the
  1555. dimensions will be magnified so that, in this case, {\tt \\hsize}
  1556. would be 6 inches in the final output.  This means that all the
  1557. dimensions will increase uniformly when {\tt \\magnification} is
  1558. used.  But for some special situations it might not be desirable
  1559. for this to happen; for example, you might want to leave a space
  1560. of exactly 3 inches to insert a figure.  In this case any unit
  1561. can be modified by {\tt true} so that {\tt \\hsize = 5 true in}
  1562. will always set the line width to 5 inches, regardless of
  1563. magnification. \TeXref{59--60} \toindex{magnification}
  1564.  
  1565. \exercise Put {\tt \\magnification = \\magstep 1} as the first
  1566. line in one of your input files and see how the output changes.
  1567.  
  1568. \subsection{Paragraph shape}
  1569.  
  1570. When \TeX{} is reading the text to be typeset from your input
  1571. file, it reads in a paragraph at a time and then typesets it.
  1572. This means that there is a lot of control over paragraph shapes,
  1573. but also that some care must be taken.  We've already seen that
  1574. {\tt \\hsize} can be used to control the width of a single
  1575. paragraph.  But suppose the following appeared as part of your
  1576. input file:
  1577.  
  1578. \beginuser
  1579. \\hsize = 5 in
  1580. Four score and seven years $\ldots$
  1581. $\vdots$
  1582. $\ldots$ from this earth.
  1583. \\hsize = 6.5 in
  1584.  
  1585. \enduser
  1586.  
  1587. What is the width of the paragraph?  The {\tt \\hsize} was
  1588. changed at the start of the paragraph and again at the end.
  1589. Since the paragraph was not completed (by putting in a blank line
  1590. or {\tt \\par}) until after the second change, the paragraph
  1591. would be typeset with a width of 6.5 inches. However, if a blank
  1592. line were inserted before {\tt \\hsize = 6.5 in}, then the
  1593. paragraph would be typeset with a width of 5 inches.  So, in
  1594. general, when a paragraph is set, the values of the parameters
  1595. that are in effect when the paragraph is completed are the ones
  1596. that are used.
  1597.  
  1598. Here is a table with some paragraph parameters:
  1599.  
  1600. \maketable [Some paragraph shape parameters]
  1601. \halign{
  1602.    \strut \hfil # & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1603.    \bf Function & \bf \TeX{} Control Word & \bf \TeX{} default\cr
  1604.    \noalign{\hrule} \noalign{\smallskip}
  1605.    width & \\hsize & 6.5 inches \cr
  1606.    indentation on first line & \\parindent & 20 points\cr
  1607.    distance between lines   & \\baselineskip & 12 points\cr
  1608.    distance between paragraphs & \\parskip & 0 points \cr
  1609.       }
  1610.  
  1611. \toindex{parindent}
  1612. \toindex{parskip}
  1613. \toindex{baselineskip}
  1614.  
  1615. The control word {\tt \\noindent} may be used at the beginning of
  1616. a paragraph to avoid the automatic indentation on the first line.
  1617. This control word will only affect the paragraph being set when
  1618. it is invoked (of course {\tt \\parindent = 0 pt} will cause no
  1619. indentation for all paragraphs).
  1620. \toindex{noindent}
  1621.  
  1622. {\narrower
  1623. A more flexible way to control the width of a paragraph is to use
  1624. {\tt \\rightskip} and {\tt \\leftskip}.  Setting {\tt \\leftskip
  1625. = 20 pt} causes the left margin of the paragraph to be moved in
  1626. an extra twenty points. Negative values may be assigned to {\tt
  1627. \\leftskip} to move the left margin out. The control word {\tt
  1628. \\rightskip} does the same to the right side of the paragraph.
  1629. The single control word {\tt \\narrower} is the equivalent of
  1630. setting both {\tt \\leftskip} and {\tt \\rightskip} equal to {\tt
  1631. \\parindent}.  This is quite useful for long quotations, and
  1632. this paragraph is an example of its use. As with {\tt \\hsize},
  1633. the value of {\tt \\leftskip} and {\tt \\rightskip} in effect
  1634. when the paragraph is completed is the one which will apply to
  1635. the whole paragraph.
  1636. \TeXref{100}
  1637.  
  1638. }
  1639. \toindex{leftskip}
  1640. \toindex{rightskip}
  1641. \toindex{narrower}
  1642.  
  1643. \exercise Make two paragraphs with the following specifications:
  1644. the left margin of both paragraphs is indented by 1.5 inches,
  1645. the right margin of the first paragraph is indented by 0.75
  1646. inches, and the right margin of the second paragraph is indented
  1647. by 1.75 inches.
  1648. \bigskip
  1649.  
  1650. \def\hangparagraph{ Lines can be made with different lengths
  1651. within one paragraph by using {\tt \\hangindent} and {\tt
  1652. \\hangafter}.  The amount of the indentation is determined by value
  1653. of {\tt \\hangindent}. If {\tt \\hangindent} is positive, the
  1654. indentation is made from the left, and if it is negative it is
  1655. made from the right. The lines on which the indentation occurs is
  1656. controlled by {\tt \\hangafter}.  If {\tt \\hangafter} is
  1657. positive then it determines the number of lines at full width
  1658. before the indentation starts.  Thus if {\tt \\hangindent = 1.75
  1659. in} and {\tt \\hangafter = 6}, then the first six lines will be
  1660. at full width and the rest will be indented by 1.75 inches from
  1661. the left. On the other hand if {\tt \\hangindent = \hbox{-1.75}
  1662. in} and {\tt \\hangafter = -6}, then the first six lines will be
  1663. indented by 1.75 inches from the right and the rest will be at
  1664. full width. \TeX{} resets to the default values {\tt \\hangindent
  1665. = 0 pt} and {\tt \\hangafter = 1} after each paragraph. These
  1666. control words are useful for paragraphs with ``hanging indents''
  1667. and for flowing a paragraph around space reserved for a figure.
  1668. \TeXref{355}The control word {\tt \\hang} at the beginning of the
  1669. paragraph will cause the first line to be of full width ({\tt
  1670. \\hangafter=1}) and the rest of the paragraph to be indented by
  1671. the current value of {\tt \\parindent}. But you do have to use
  1672. {\tt \\noindent} if you want the first line to extend all the way
  1673. to the left margin.
  1674. \TeXref{102}
  1675. \par}
  1676.  
  1677. \hangafter=6 \hangindent=1.75in
  1678. \hangparagraph
  1679. \toindex{hangindent}
  1680. \toindex{hangafter}
  1681. \toindex{hang}
  1682.  
  1683. Here is the previous paragraph repeated with {\tt \\hangafter = -6}
  1684. and {\tt \\hangindent = -1.75 in}.
  1685.  
  1686. \hangafter=-6 \hangindent=-1.75in \hangparagraph
  1687.  
  1688.  
  1689. The control word {\tt \\parshape} can be used to make paragraphs with
  1690. a greater variety of shapes.
  1691. \TeXref{101}
  1692. \toindex{parshape}
  1693.  
  1694. Another useful control word for setting paragraphs is {\tt \\item}.
  1695. It can be used to make various types of itemized lists,
  1696. and is invoked using the pattern {\tt \\item\lb$\ldots$\rb}\null.
  1697. This causes the next  paragraph to be formed with every line
  1698. indented by {\tt \\parindent} and, in addition, the first line
  1699. labeled on the left by whatever is between the braces.  It is
  1700. usually used with {\tt \\parskip = 0 pt}, since that control word
  1701. determines the vertical space between the different items. The control
  1702. word {\tt \\itemitem} is the same as {\tt \\item} except that the
  1703. indentation is twice as far, that is, twice the value of
  1704. {\tt \\parindent}.
  1705. \TeXref{102}Here is an example:
  1706. \toindex{item}
  1707. \toindex{itemitem}
  1708.  
  1709. \beginliteral
  1710. \parskip = 0pt \parindent = 30 pt
  1711. \noindent
  1712. Answer all the following questions:
  1713. \item{(1)} What is question 1?
  1714. \item{(2)} What is question 2?
  1715. \item{(3)} What is question 3?
  1716. \itemitem{(3a)} What is question 3a?
  1717. \itemitem{(3b)} What is question 3b?
  1718. @endliteral
  1719.  
  1720.  
  1721. \noindent
  1722. will produce
  1723. \vfill\eject
  1724.  
  1725. {\parskip = 0pt \parindent = 30 pt
  1726. \noindent
  1727. Answer all the following questions:
  1728. \item{(1)} What is question 1?
  1729. \item{(2)} What is question 2?
  1730. \item{(3)} What is question 3?
  1731. \itemitem{(3a)} What is question 3a?
  1732. \itemitem{(3b)} What is question 3b?
  1733.  
  1734. }
  1735.  
  1736. \exercise Make a paragraph several lines long and use it with
  1737. the {\tt \\item} control word to see the ``hanging indent.'' Now
  1738. take the same paragraph and use it with different values of {\tt
  1739. \\parindent} and {\tt \\hsize}.
  1740. \bigskip
  1741.  
  1742. Now let's see how to put space between paragraphs.  The control
  1743. word {\tt \\parskip} is used to determine how much space is
  1744. normally left between paragraphs. So if you put {\tt \\parskip =
  1745. 12 pt} at the beginning of your \TeX{} source file, there will be
  1746. 12 points between paragraphs unless other instructions are
  1747. given. The control word {\tt \\vskip} can be used to insert extra
  1748. vertical space between paragraphs.  If {\tt \\vskip 1 in} or {\tt
  1749. \\vskip 20 pt} appears between two paragraphs, then the extra
  1750. space is inserted.
  1751.  
  1752. There are a couple of peculiarities of {\tt \\vskip} that seem
  1753. quite strange at first.  If you have {\tt \\vskip 3 in} and the
  1754. skip starts two inches from the bottom of the page, the rest of
  1755. the page is skipped, but the extra one inch is {\it not\/}
  1756. skipped at the top of the next page.  In other words, {\tt \\vskip}
  1757. {\bf will not insert space across page boundaries}.  In
  1758. fact, {\tt \\vskip~1~in} will have no effect at all if it happens
  1759. to appear at the top of a page! For many types of vertical
  1760. spacing this is quite appropriate.  The space before a section
  1761. heading, for example, should not continue across page boundaries.
  1762.  
  1763. A similar phenomenon occurs at the beginning of your document.
  1764. If, for example, you want a title page with the title about half
  1765. way down the page, you can not insert the space at the top of the
  1766. page using {\tt \\vskip}.
  1767.  
  1768. But what if you really want some blank space at the top of a
  1769. page? You could start the page with {\tt\\\sp} but this in effect
  1770. typesets a one line paragraph containing a blank. So while
  1771. nothing is typeset, the extra space due to the values of {\tt
  1772. \\baselineskip} and {\tt \\parskip} will add extra space. An easier
  1773. method is to use {\tt \\vglue} instead of {\tt \\vskip} to get
  1774. the desired result.  Thus {\tt \\vglue 1 in\ }will leave one inch
  1775. of blank space at the top of the page.\TeXref{352}
  1776. \toindex{vglue}
  1777.  
  1778.  
  1779. We can note in passing that there is another more general method
  1780. to put material at the top of a page using the control words {\tt
  1781. \\topinsert} and {\tt \\endinsert}. If {\tt \\topinsert $\ldots$
  1782. \\endinsert} is used within a page, the material between
  1783. {\tt \\topinsert} and {\tt \\endinsert} will appear at the top
  1784. of the page, if possible. For example:
  1785.  
  1786. \vbox{
  1787.    \beginuser
  1788.    \\topinsert
  1789.    \\vskip 1 in
  1790.    \\centerline\lb Figure 1\rb
  1791.    \\endinsert
  1792.    \enduser
  1793. }
  1794. \noindent
  1795. is useful for inserting figures of a prescribed size.
  1796. \TeXref{115}
  1797. \toindex{topinsert}
  1798. \toindex{endinsert}
  1799.  
  1800. There are also some special control words for making small
  1801. vertical skips. They are {\tt \\smallskip}, {\tt \\medskip}, and
  1802. {\tt \\bigskip}. Here is the size of each one:
  1803.  
  1804. \def\hrl{\hrule width .5 in}
  1805.  
  1806. \centerline{{\tt \\smallskip}: \vbox{\hrl \smallskip \hrl} \quad
  1807.             {\tt \\medskip}: \vbox{\hrl \medskip \hrl} \quad
  1808.             {\tt \\bigskip}: \vbox{\hrl \bigskip \hrl}
  1809.             }
  1810. \toindex{smallskip}
  1811. \toindex{medskip}
  1812. \toindex{bigskip}
  1813.  
  1814. \subsection{Line shape}
  1815.  
  1816. For most material \TeX{} does a good job of breaking up a
  1817. paragraph into lines.  But sometimes it's necessary to add
  1818. further instructions. It's possible to force a new line by
  1819. inserting {\tt \\hfill \\break} in your input file. It's also
  1820. possible to  put some text on a line by itself using the control
  1821. word {\tt \\line\lb $\ldots$\rb}; then the material between the
  1822. braces will be restricted to one line (although the result will
  1823. be spread out over the whole line and may be horrible). The
  1824. control words {\tt \\leftline\lb $\ldots$\rb}, {\tt \\rightline\lb
  1825. $\ldots$\rb}, and {\tt \\centerline\lb $\ldots$\rb} will,
  1826. respectively, set the material between the braces on a single
  1827. line on the left margin, on the right margin, or \centred.  Thus
  1828. \toindex{hfill}
  1829. \toindex{break}
  1830. \toindex{centerline}
  1831. \toindex{leftline}
  1832. \toindex{rightline}
  1833. \toindex{line}
  1834.  
  1835.  
  1836. \beginliteral
  1837. \leftline{I'm over on the left.}
  1838. \centerline{I'm in the @centre.}
  1839. \rightline{I'm on the right.}
  1840. \line{I just seem to be spread out all over the place.}
  1841. @endliteral
  1842.  
  1843. \noindent
  1844. produces the four lines:
  1845. \vskip\baselineskip
  1846.  
  1847.  
  1848. {
  1849. \hbadness = 10000
  1850. \leftline{I'm over on the left.}
  1851. \centerline{I'm in the \center.}
  1852. \rightline{I'm on the right.}
  1853. \line{I just seem to be spread out all over the place.}
  1854.  
  1855. Other types of spacing can be obtained by using the control word {\tt
  1856. \\hfil}.  This causes all the extra space in the line to be
  1857. accumulated at the position where {\tt \\hfil} appears.
  1858. Thus if we alter our last example to
  1859. {\tt \\line\lb I just seem to be spread out \\hfil all over the place.\rb}
  1860. we will get \hfil\break
  1861. \medskip
  1862. \line{I just seem to be spread out \hfil all over the place.}
  1863. \medskip
  1864. If we have more than one {\tt \\hfil}, they will divide any extra
  1865. space among themselves equally.  Hence
  1866. {\tt \\line\lb left text \\hfil \centre{} text \\hfil right text.\rb}
  1867. will produce
  1868. \medskip
  1869. \line{left text \hfil \centre{} text \hfil right text.}
  1870. \toindex{hfil}
  1871. }
  1872.  
  1873. \exercise Typeset the following line:
  1874.  
  1875. \line{left end \hfil left tackle \hfil left guard \hfil \centre{} \hfil
  1876. right guard \hfil right tackle \hfil right end}
  1877.  
  1878. \exercise Typeset the following line with twice as much space between
  1879. ``left'' and ``right-\centre{}'' as between ``right-\centre{}'' and
  1880. ``right'':
  1881.  
  1882. \line{left \hfil \hfil right-\centre{} \hfil right}
  1883.  
  1884. It's possible to move horizontally using {\tt \\hskip} in a
  1885. manner analogous with {\tt \\vskip}.
  1886. \toindex{hskip}
  1887.  
  1888. \exercise What happens with the following input:\hfil\break
  1889. {\tt \\line\lb\\hskip 1 in ONE \\hfil TWO \\hfil THREE\rb}
  1890. \bigskip
  1891.  
  1892. The right justification can be canceled by using the
  1893. control word {\tt \\raggedright}.
  1894. \toindex{raggedright}
  1895.  
  1896. \subsection{Footnotes}
  1897.  
  1898. The general pattern to make footnotes using \TeX{} is
  1899. {\tt \\footnote\lb$\ldots$\rb\lb$\ldots$\rb}\null.
  1900.  
  1901. The footnote mark goes in between the first set of braces.  Some
  1902. available marks are {\tt \\dag (\dag)}, {\tt \\ddag (\ddag)}, {\tt \\S
  1903. (\S)}, and {\tt \\P (\P)}\null.  The text of the footnote
  1904. goes between the second set of braces. The use of numbers as
  1905. marks is a little less straightforward. The footnote%
  1906. \footnote{${}^{21}$}{This is the footnote at the bottom of the page.}
  1907. at the bottom of the page was produced by using {\tt \\footnote\lb\$\lb
  1908. \rb\^{}\lb{21}\rb\$\rb\lb This is the footnote at the
  1909. bottom of the page.\rb}  after the word ``footnote'' in the
  1910. text. This construction is somewhat complicated; we'll see why
  1911. it's this way when we know a little more about typesetting
  1912. mathematics. But for the moment we can look at it as a way of
  1913. getting the job done. You may want to use {\tt \\rm} within the
  1914. footnote to ensure that the right font appears. Usually you will
  1915. not want a space between the text and the control word {\tt
  1916. footnote}.\TeXref{117}
  1917. \toindex{footnote}
  1918. \toindex{ddag}
  1919. \toindex{S}
  1920. \toindex{P}
  1921.  
  1922. \exercise Make up a page with a relatively long footnote spanning
  1923. several lines.
  1924.  
  1925. \exercise Make up a page with two different footnotes on it.
  1926.  
  1927. \subsection{Headlines and Footlines}
  1928.  
  1929. \headline={\hfil \tenrm Page \the\pageno} %example for this section
  1930.  
  1931. The lines for title and page numbers that go above and below the
  1932. main text are produced by using {\tt \\headline=\lb$\dots$\rb}
  1933. and {\tt \\footline=\lb$\dots$\rb}\null.
  1934. \TeXref{252--253}
  1935.  
  1936. The principle is the same as using the control word {\tt \\line\lb
  1937. $\dots$\rb} within the usual text on the page.  A helpful
  1938. control word is {\tt \\pageno} which represents the current page
  1939. number. Thus {\tt \\headline=\lb\\hfil \\tenrm Page \\the\\pageno\rb}
  1940. would cause the page number to appear in the upper
  1941. right corner preceded by the word ``Page'' (now look at the upper
  1942. right corner of this page). It is safer to explicitly name the
  1943. font that you want to use (in this case {\tt \\tenrm} to use the
  1944. 10 point roman font), since you are never guaranteed that a
  1945. particular font will be in use when the headline or footline is
  1946. set. The control word {\tt \\the} takes the internal value of the
  1947. next word if it is an appropriate control word and prints it as
  1948. text. You can also use the control word {\tt \\folio} instead of
  1949. {\tt \\the \\pageno}. The difference is that {\tt \\folio} will
  1950. give roman numerals when {\tt \\pageno} is negative.
  1951. \toindex{headline}
  1952. \toindex{footline}
  1953. \toindex{pageno}
  1954. \toindex{the}
  1955. \toindex{folio}
  1956.  
  1957. You can also assign values to {\tt \\pageno} if you want your
  1958. document to use a different sequence of page numbers from the
  1959. usual.  Roman numerals can be produced by using negative numbers;
  1960. {\tt \\pageno=-1} at the beginning of a document will cause page
  1961. numbers to be in roman numerals.
  1962. \TeXref{252}
  1963.  
  1964. Different headlines can be produced for even and odd pages in
  1965. the following manner:
  1966.  
  1967. {\tt
  1968. \\headline=\lb\\ifodd \\pageno \lb$\dots$\rb \\else \lb$\dots$\rb
  1969. \\fi\rb}
  1970.  
  1971. \noindent
  1972. where the material between the first set of braces is for the
  1973. right-hand pages and the material between the second set of
  1974. braces is for the left-hand pages.
  1975.  
  1976. \exercise Change the footline so that the page number is \centred{}
  1977. with an en-dash on either side.
  1978.  
  1979. \subsection{Overfull and underfull boxes}
  1980.  
  1981. One of the most frustrating experiences for the new \TeX{} user
  1982. is the occurrence of overfull and underfull boxes.  They are duly
  1983. noted in the log file and are also written to the screen when \TeX{}
  1984. is being run interactively.  Overfull boxes are also marked
  1985. on the output by a slug (a large filled-in black rectangle that
  1986. looks like this: \vrule width \overfullrule) in the right
  1987. margin. Various obscene terms are applied to this slug.  It
  1988. appears even though there is nothing wrong with the \TeX{} input.
  1989. So why is the slug there and what can be done about it?
  1990.  
  1991. A good way to visualize the way \TeX{} organizes a page is to
  1992. think of the printed material as being put into boxes. There are
  1993. two types of boxes: {\sl hboxes\/} and {\sl vboxes}.  Most of the
  1994. time these correspond to the organization of horizontal text
  1995. into lines and vertical paragraphs into pages.  In particular, it
  1996. is the spacing of the words in a hbox corresponding to a line of
  1997. text that causes the slug to appear.
  1998.  
  1999. Recall that \TeX{} reads in the complete paragraph before
  2000. deciding how to break it up into lines.  This is better than
  2001. working a line at a time, since a slight improvement in one line
  2002. might cause catastrophic changes farther down in the paragraph.
  2003. When words are gathered together to form a line, space is added
  2004. between the words to justify the right margin. Very large spaces
  2005. between words is obviously undesirable; the badness of the line
  2006. is a measure of how badly the words are spaced.  An underfull
  2007. hbox means that there is too much space between words.  More
  2008. specifically, the badness of any line is a number between 0
  2009. (perfect) and 10000 (horrible).  There is a parameter called {\tt
  2010. \\hbadness} whose default value is 1000\null.  Any line whose
  2011. badness is greater than {\tt \\hbadness} is reported as an
  2012. underfull hbox.  If the value of {\tt \\hbadness} is increased,
  2013. then fewer underfull hboxes will be reported. In fact {\tt
  2014. \\hbadness = 10000} will suppress the reporting of underfull
  2015. hboxes altogether. Similarly, if the words must be squeezed into
  2016. a line so that the spaces are very small or even so the words
  2017. extend a little into the right margin, then an overfull hbox
  2018. results. \toindex{hbadness}
  2019.  
  2020. %%%%%%%%%%%%%% restore original headline %%%%%%%%%%%%%%%%%%%%%%%%
  2021. \headline={\iftitlepage \hfil \global\titlepagefalse
  2022.                                       \else \gentleheadline \fi}
  2023.  
  2024. In a similar way, sometimes \TeX{} allows a line to be slightly
  2025. longer than {\tt \\hsize} in order to achieve a more balanced
  2026. appearance. The control word {\tt \\tolerance} determines when
  2027. this happens.  If the badness of a line is greater than {\tt
  2028. \\tolerance}, \TeX{} will make the line longer by adding a new word
  2029. at the end of the line, even though it might exceed the value of
  2030. {\tt \\hsize}. A line which is only slightly longer is set
  2031. without being reported. The control word {\tt \\hfuzz} determines
  2032. how much excess is allowed; the default is {\tt \\hfuzz
  2033. =~0.1~pt}.  A line that is more than slightly longer than {\tt \\hsize}
  2034. is obviously a serious problem; \TeX{} puts a slug in
  2035. the margin to make its point forcefully. It's possible to avoid
  2036. overfull hboxes altogether by increasing the value of {\tt \\tolerance}.
  2037. With {\tt \\tolerance = 10000} there will never be
  2038. overfull boxes or slugs. The default is {\tt \\tolerance = 200}\null.
  2039. \TeXref{29}
  2040. \toindex{hfuzz}
  2041. \toindex{tolerance}
  2042.  
  2043. The width of the slug is determined by the control word {\tt
  2044. \\overfullrule}.  Including {\tt \\overfullrule = 0 pt} in your
  2045. file will delete any further  printing of the slugs.  The
  2046. overfull boxes will still be there, of course, and they will
  2047. probably be harder to spot.
  2048. \toindex{overfullrule}
  2049.  
  2050. So we see why overfull boxes and underfull boxes are reported; we
  2051. can also change the reporting by changing the values of {\tt
  2052. \\badness}, {\tt \\hfuzz}, and {\tt \\tolerance}.  In addition, a
  2053. small value of {\tt \\hsize} obviously makes it more difficult to
  2054. set lines and causes more overfull and underfull hboxes to be
  2055. reported. These are warnings that you ignore at your own peril!
  2056.  
  2057. Adding new possibilities of hyphenation will sometimes eliminate
  2058. an overfull box. \TeX{} has automatic hyphenation and usually
  2059. finds good places to hyphenate a word; however, it's possible to
  2060. add hyphenations to let lines break at new places.  For example,
  2061. the automatic hyphenation will never put a hyphen in the word
  2062. ``database''.  If you type in {\tt data\\-base}, it will allow a
  2063. hyphen to be inserted after the second letter ``a'' in the word.
  2064. More generally, if you put {\tt \\hyphenation\lb data-base\rb} in
  2065. the beginning of your input file, then all occurrences of the
  2066. word ``database'' will allow hyphenation after the letter ``a''.
  2067. \TeXref{28} The log file will show the possible hyphenations on
  2068. the line containing the overfull or underfull box. Sometimes the
  2069. best solution to an overfull or underfull hbox is a little
  2070. judicious editing of the original document.
  2071. \toindex{hyphenation}
  2072.  
  2073. Our discussion has involved the setting of type into lines, that is,
  2074. the horizontal page structure.  There are several vertical \analog{}s.
  2075. Overfull and underfull hboxes indicate how well words are gathered
  2076. into lines.  Similarly, overfull and underfull vboxes are reported
  2077. when paragraphs are gathered to form pages.  A large table that
  2078. can't be broken in the middle, for example, can produce an underfull
  2079. vbox that is reported in the log file when the page being typeset is
  2080. completed.  The control word {\tt \\vbadness} works for the vertical
  2081. placement of text in the same way as {\tt \\hbadness} works for
  2082. horizontal text.
  2083. \toindex{vbadness}
  2084.  
  2085. \exercise Take a few paragraphs and print them using various (small)
  2086. values of {\tt \\hsize} to see what kind of overfull boxes result.
  2087. Repeat with various values of {\tt \\hbadness}, {\tt \\hfuzz}, and
  2088. {\tt \\tolerance}.
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095. \section{$\Bigl\{$Groups, $\bigl\{$Groups,
  2096.         $\{$and More Groups$\}\bigr\}\Bigr\}$}
  2097.  
  2098. The concept of gathering text into groups allows \TeX{} input
  2099. files to be greatly simplified.  A new group is started by the
  2100. character {\tt\lb} and terminated by the character {\tt \rb}\null.
  2101. Changes made within a group will lose their effect when the
  2102. group terminates.  So, for example if {\tt \lb \\bf three
  2103. boldface words\rb} appears in your text, the opening brace starts
  2104. the group, the {\tt \\bf} control word changes to a boldface
  2105. font, and the closing brace finishes up the group.  Upon
  2106. completion of the group the font being used is the one in effect
  2107. before the group started.  This is the (easier) way of having a
  2108. few words in a different font.  It's also possible to have groups
  2109. nested within groups.
  2110.  
  2111.  
  2112. As another example, size changes can be made in the text that are
  2113. only temporary.  For example
  2114. \beginuser
  2115. \lb
  2116. \\hsize = 4 in
  2117. \\parindent = 0 pt
  2118. \\leftskip = 1 in
  2119. will produce a paragraph that is four
  2120. $\vdots$
  2121. (this is an easy mistake to make).
  2122. \\par
  2123. \rb
  2124. \enduser
  2125.  
  2126. {\hsize = 4 in
  2127. \parindent = 0 pt
  2128. \leftskip = 1 in
  2129. will produce a paragraph that is four inches wide with the text
  2130. offset into the paragraph by one inch regardless of the settings
  2131. in effect before the start of the group.  This paragraph is set
  2132. with those values. After the end of the group, the old settings
  2133. are in effect again. Note that it is necessary to include
  2134. {\tt \\par} or to use a blank line before the closing brace to end
  2135. the paragraph, since otherwise the group will end and \TeX{} will
  2136. go back to the old parameters before the paragraph is actually
  2137. typeset (this is an easy mistake to make). \par}
  2138.  
  2139. When line-spacing control words (like {\tt \\centerline}) act on text
  2140. following it in braces, that text is implicitly in a group. Thus
  2141. {\tt \\centerline\lb\\bf A bold title\rb} will produce a \centred{}
  2142. boldface line, and the text following that line will be in
  2143. whatever font was in effect before the {\tt \\centerline} was
  2144. invoked.
  2145.  
  2146. The empty group {\tt\lb\rb} is useful.  One use allows accents to be
  2147. typeset with no accompanying letter.  For example, {\tt \\\~{}\lb\rb}
  2148. will print a tilde with no letter under it.  It can also be used to
  2149. stop \TeX{} from eating up consecutive spaces. Hence {\tt I use
  2150. \\TeX\lb\rb{} all the time}  will leave a space after ``\TeX'' in the
  2151. output. This is an alternative to using {\tt \\\sp} as we did in
  2152. Section~1.
  2153. \TeXref{19--21}
  2154.  
  2155. Grouping can also be used to avoid spaces in the middle of a word
  2156. when including accents. Either {\tt soup\\c\sp con} or {\tt
  2157. soup\\c\lb c\rb on} will produce the word soup\c{c}on.
  2158.  
  2159. \exercise Change the dimensions of one paragraph on a page using the
  2160. grouping idea.
  2161.  
  2162. \exercise Mathematicians sometime use the word ``i{f}f'' as an
  2163. abbreviation for ``if and only if''\null.  In this case it looks
  2164. better if the first and second letter ``f'' are {\sl not\/}
  2165. joined as a ligature.  How do you do this (there are several
  2166. solutions)?
  2167.  
  2168. It's really easy to forget to match braces properly.  The effect
  2169. can be dramatic; if you get output that suddenly changes to an
  2170. italic font for the rest of the document, a mismatched brace is
  2171. probably the cause.  If you have an extra {\tt \lb} \TeX{} will
  2172. give a message in the log file: {\tt (\\end occurred inside a
  2173. group at level 1)}. An extra {\tt\rb} will result in the message
  2174. \hbox{\tt! Too many \rb's.}
  2175.  
  2176. Here's a little hint to help you keep track of the braces in more
  2177. complicated groups: put the opening brace on a line by itself and
  2178. do the same for the closing brace.  If there are braces nested
  2179. within the original ones, put them on separate lines also, but
  2180. indent them a few spaces.  The text within the nested braces can
  2181. also be indented since \TeX{} ignores all spaces at the beginning
  2182. of a line. The matching braces will then stand out when you look
  2183. at your \TeX{} source file.  In fact, if your editor is smart
  2184. enough, you can create the two lines with the braces first and
  2185. then insert the appropriate material within them with automatic
  2186. indenting.
  2187.  
  2188. \exercise In section 2 we changed fonts the following method:
  2189. {\tt I started with roman type, \\it switched to italic type,
  2190. \\rm and returned to roman type}. Get the same result using the
  2191. idea of grouping.
  2192.  
  2193.  
  2194. \section{No math anxiety here!}
  2195.  
  2196. \TeX{} is at its best when typesetting mathematics.  The
  2197. conventions for doing this are many and complex, and the ability
  2198. of \TeX{} to take them into account makes the production of high
  2199. quality, attractive mathematical output possible.  If you plan to
  2200. produce papers with mathematical symbols in them, this section
  2201. will give you all the basics necessary for creating beautiful
  2202. output in almost all circumstances; \TeX{} may be used without
  2203. any mathematics, of course, and if this is your goal, then the
  2204. following two subsections are probably sufficient for your needs.
  2205.  
  2206. \subsection{Lots of new symbols}
  2207.  
  2208. Mathematical text is inserted into normal text in two possible
  2209. ways: it can be {\sl in-line\/}, that is, as part of the usual
  2210. lines of text.  It can also be {\sl displayed}, that is, \centred{}
  2211. in a gap between the usual text.  The results in the spacing and
  2212. placement of symbols can be quite different in each case.  The
  2213. in-line equation $\sum_{k=1}^{\infty} {1\over k^2} = {\pi^2\over6}$
  2214. is easily seen to be different from the same equation when
  2215. displayed:
  2216. $$\sum_{k=1}^{\infty} {1\over k^2} = {\pi^2\over6}.$$
  2217.  
  2218. Since the spacing and the fonts used for mathematics are quite
  2219. different from those of ordinary text, \TeX{} needs to be told
  2220. when mathematics rather than normal text is being typeset.  This
  2221. is done using the {\tt\$} symbol.  More specifically, mathematics
  2222. is typeset in-line by surrounding the symbols to be entered by
  2223. single dollar signs: {\tt \$$\ldots$\$}, and is typeset displayed
  2224. by surrounding the symbols to be entered by double dollar signs:
  2225. {\tt \$\$$\ldots$\$\$}\null.  Hence {\tt \$x = y+1\$} will give
  2226. $x=y+1$ in-line while {\tt \$\$x = y+1.\$\$} will display
  2227. $$x=y+1.$$
  2228.  
  2229. The spacing for both in-line and displayed mathematics is
  2230. completely controlled by \TeX\null.  Adding spaces to your input
  2231. has no effect at all.  What if you need a space or some text in
  2232. the middle of some mathematics?  You can insert text by inserting
  2233. it into an hbox (don't worry about the definition of an hbox for
  2234. now): {\tt \\hbox\lb$\ldots$\rb}\null.  This is particularly
  2235. useful for displayed mathematics.  Hence ``$x=y+1 \hbox{ whenever
  2236. } y=x-1$'' can be typeset using {\tt \$x=y+1 \\hbox\lb\ whenever
  2237. \rb y=x-1\$}. Note the spaces on either side of the word within
  2238. the braces. Usually it isn't necessary to insert spaces into
  2239. mathematical text, but here are the control sequences that do the
  2240. job.
  2241. \TeXref{167}
  2242.  
  2243. \maketable [Adding space to mathematical text]
  2244. \halign{
  2245. \strut \hfil # & \quad \hfil\tt# \hfil \quad
  2246.    & \hbox to 2cm{\hrulefill\vrule height 8pt#\vrule height 8pt\hrulefill} \cr
  2247.    Name & \rm Control Sequence & \hfil{}$\gets$Size$\to$\cr
  2248.    \noalign{\hrule} \noalign{\smallskip}
  2249.    Double quad         & \\qquad &\qquad \cr
  2250.    Quad                & \\quad  &\quad \cr
  2251.    Space               & \\\sp\   &\ \cr
  2252.    Thick space         & \\;     &$\;$\cr
  2253.    Medium space        & \\>     &$\>$\cr
  2254.    Thin space          & \\,     &$\,$\cr
  2255.    Negative thin space & \ \\!\    &$\!$\cr
  2256.        }
  2257.  
  2258. \toindex{quad}
  2259. \toindex{qquad}
  2260. \toindex{\sp}
  2261. \toindex{;}
  2262. \toindex{>}
  2263. \toindex{,}
  2264. \toindex{!}
  2265.  
  2266. If you look closely at the negative thin space, you'll notice
  2267. that, unlike the other entries, the two arms overlap.  This is
  2268. because the negative space is one in the opposite direction, that
  2269. is, while the other control sequences increase the amount of
  2270. space between two symbols being typeset, the negative thin space
  2271. decreases the space between them, even if it causes them to
  2272. overlap.
  2273.  
  2274. \exercise Typeset the following: $C(n,r) = n!/(r!\,(n-r)!)$\null. Note the
  2275. spacing in the denominator.
  2276. \bigskip
  2277.  
  2278. You shouldn't have any blank lines between the dollar signs
  2279. delimiting the mathematical text. \TeX{} assumes that all the
  2280. mathematical text being typeset is in one paragraph, and a blank
  2281. line starts a new paragraph; consequently, this will generate an
  2282. error message. This turns out to be useful, for one of the
  2283. easiest errors to make is to forget to put in the trailing dollar
  2284. sign(s) after the mathematical input (I promise that you'll do it
  2285. at least once while learning \TeX{}); if \TeX{} allowed more than
  2286. one paragraph to be between the dollars signs, then one omitted
  2287. trailing dollar sign might cause the rest of the document to be
  2288. typeset as mathematics.
  2289.  
  2290. Most mathematical text is entered in exactly the same way for
  2291. in-line typesetting as for displayed typesetting (except for the
  2292. surrounding dollar signs, of course). The exceptions, such as
  2293. aligning multiline displays and placing equation numbers at the
  2294. left or right margin will be discussed in the last part of this
  2295. section.
  2296.  
  2297. Many new symbols can appear when typesetting mathematics.  Most
  2298. of the ones that actually appear on the keyboard can be used
  2299. directly. The symbols {\tt + - / * = ' | < > (} and {\tt )} are
  2300. all entered directly. Here they are as mathematics: $+ - / * =\>
  2301. '\> | <\> >\> ( \> )$.
  2302.  
  2303. \exercise Typeset the equation $a+b=c-d=xy=w/z$ as in-line and
  2304. displayed mathematical text.
  2305.  
  2306. \exercise Typeset the equation $(fg)' = f'g + fg'$ as in-line and
  2307. displayed mathematical text.
  2308. \bigskip
  2309.  
  2310. Many other symbols, as you would expect, are predefined control
  2311. words.  All Greek letters are available.  Here is a table of them:
  2312. \TeXref{434}
  2313.  
  2314. \maketable [Greek letters]
  2315. \halign{
  2316. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad
  2317.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr
  2318. \noalign{\hrule} \noalign{\smallskip}
  2319. \alpha & \\alpha &\beta & \\beta &\gamma & \\gamma &\delta & \\delta \cr
  2320. \epsilon & \\epsilon & \varepsilon & \\varepsilon & \zeta & \\zeta &
  2321. \eta & \\eta \cr
  2322. \theta & \\theta & \vartheta & \\vartheta & \iota & \\iota & \kappa &
  2323. \\kappa \cr
  2324. \lambda & \\lambda & \mu & \\mu & \nu & \\nu & \xi & \\xi \cr
  2325. o & o & \pi & \\pi & \rho & \\rho & \varrho & \\varrho \cr
  2326. \sigma & \\sigma & \varsigma & \\varsigma & \tau & \\tau & \upsilon &
  2327. \\upsilon \cr
  2328. \phi & \\phi & \varphi & \\varphi & \chi & \\chi & \psi & \\psi \cr
  2329. \omega & \\omega & \Gamma & \\Gamma & \Delta & \\Delta & \Theta &
  2330. \\Theta \cr
  2331. \Lambda & \\Lambda & \Xi & \\Xi & \Pi & \\Pi & \Sigma & \\Sigma \cr
  2332. \Upsilon & \\Upsilon & \Phi & \\Phi & \Psi & \\Psi & \Omega & \\Omega \cr
  2333.        }
  2334.  
  2335. \toindex{alpha}
  2336. \toindex{beta}
  2337. \toindex{gamma}
  2338. \toindex{delta}
  2339. \toindex{epsilon}
  2340. \toindex{varepsilon}
  2341. \toindex{zeta}
  2342. \toindex{eta}
  2343. \toindex{theta}
  2344. \toindex{vartheta}
  2345. \toindex{iota}
  2346. \toindex{kappa}
  2347. \toindex{lambda}
  2348. \toindex{mu}
  2349. \toindex{nu}
  2350. \toindex{xi}
  2351. \toindex{pi}
  2352. \toindex{rho}
  2353. \toindex{varrho}
  2354. \toindex{sigma}
  2355. \toindex{varsigma}
  2356. \toindex{tau}
  2357. \toindex{upsilon}
  2358. \toindex{phi}
  2359. \toindex{varphi}
  2360. \toindex{chi}
  2361. \toindex{psi}
  2362. \toindex{omega}
  2363. \toindex{Gamma}
  2364. \toindex{Delta}
  2365. \toindex{Theta}
  2366. \toindex{Lambda}
  2367. \toindex{Xi}
  2368. \toindex{Pi}
  2369. \toindex{Sigma}
  2370. \toindex{Upsilon}
  2371. \toindex{Phi}
  2372. \toindex{Psi}
  2373. \toindex{Omega}
  2374.  
  2375.  
  2376. \exercise Typeset $\alpha\beta=\gamma+\delta$ as in-line and displayed
  2377. mathematical text.
  2378.  
  2379. \exercise Typeset $\Gamma(n) = (n-1)!$ as in-line and displayed
  2380. mathematical text.
  2381.  
  2382. Sometimes accents are put above or below symbols.  The control
  2383. words used for accents in mathematics are different from those
  2384. used for normal text.   The normal text control words may not be
  2385. used for mathematics and vice-versa.
  2386. \TeXref{135--136}
  2387.  
  2388. \maketable [Mathematical accents]
  2389. \halign{
  2390.    \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ &
  2391.       \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad  \cr
  2392.    \noalign{\hrule} \noalign{\smallskip}
  2393.    \hat o   & \\hat o   & \check o & \\check o  & \tilde o & \\tilde o \cr
  2394.    \acute o & \\acute o & \grave o & \\grave o  & \dot o & \\dot o \cr
  2395.    \ddot o  & \\ddot o  &\breve o  & \\breve o  & \bar o & \\bar o \cr
  2396.    \vec o   & \\vec o   & \widehat {abc} & \\widehat \lb abc\rb
  2397.                     & \widetilde {abc} & \\widetilde \lb abc\rb\cr
  2398.        }
  2399.  
  2400. \toindex{hat}
  2401. \toindex{check}
  2402. \toindex{tilde}
  2403. \toindex{acute}
  2404. \toindex{grave}
  2405. \toindex{dot}
  2406. \toindex{ddot}
  2407. \toindex{breve}
  2408. \toindex{bar}
  2409. \toindex{vec}
  2410. \toindex{widehat}
  2411. \toindex{widetilde}
  2412.  
  2413.  
  2414.  
  2415. Binary operators combine two mathematical objects to get another
  2416. object.  Ordinary addition and multiplication, for example,
  2417. combine two numbers to get another number, and so they are binary
  2418. operators. When a binary operator such as $+$ or $\times$ is
  2419. typeset, a little extra space is put around it. Here is a list of
  2420. some of the available binary operators:
  2421. \TeXref{436}
  2422.  
  2423. \maketable [Binary operators]
  2424. \halign{
  2425. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad
  2426.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr
  2427. \noalign{\hrule} \noalign{\smallskip}
  2428. \cdot & \\cdot &\times & \\times &\ast & \\ast &\star & \\star \cr
  2429. \circ & \\circ & \bullet & \\bullet & \div & \\div & \diamond & \\diamond \cr
  2430. \cap & \\cap & \cup & \\cup & \vee & \\vee & \wedge & \\wedge \cr
  2431. \oplus & \\oplus &\ominus & \\ominus & \otimes &\\otimes &\odot &\\odot \cr
  2432.        }
  2433.  
  2434. \toindex{cdot}
  2435. \toindex{times}
  2436. \toindex{ast}
  2437. \toindex{star}
  2438. \toindex{circ}
  2439. \toindex{bullet}
  2440. \toindex{div}
  2441. \toindex{diamond}
  2442. \toindex{cap}
  2443. \toindex{cup}
  2444. \toindex{vee}
  2445. \toindex{wedge}
  2446. \toindex{oplus}
  2447. \toindex{ominus}
  2448. \toindex{otimes}
  2449. \toindex{odot}
  2450.  
  2451. Ellipses are commonly used with binary operators.  The control
  2452. word {\tt \\cdots} will raise the dots so that they are level
  2453. with the binary operator. Thus {\tt \$a + \\cdots + z\$} will
  2454. produce $a + \cdots + z$.  The control word {\tt \\ldots} will
  2455. put the dots on the baseline, and so {\tt \$1\\ldots n\$}
  2456. produces $1\ldots n$.
  2457. \toindex{cdots}
  2458. \toindex{ldots}
  2459.  
  2460. \exercise Typeset: $x\wedge (y\vee z) = (x\wedge y) \vee (x\wedge z)$.
  2461.  
  2462. \exercise Typeset: $2+4+6+\cdots +2n = n(n+1)$.
  2463. \bigskip
  2464.  
  2465. A relation indicates a property of two mathematical objects.  We
  2466. already know how to show two objects equal, or how to show one
  2467. number less than or greater than another number (since these are
  2468. symbols on most terminal keyboards).  To negate a relation, the
  2469. control word {\tt \\not} is put in front of the relation.  Here
  2470. are some relations:
  2471. \TeXref{436}
  2472. \toindex{not}
  2473.  
  2474. \maketable [Relations ]
  2475. \halign{
  2476. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad
  2477.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr
  2478. \noalign{\hrule} \noalign{\smallskip}
  2479. \leq  & \\leq  &\not\leq & \\not \\leq
  2480.        & \geq & \\geq & \not\geq & \\not \\geq \cr
  2481. \equiv & \\equiv & \not\equiv & \\not \\equiv
  2482.        & \sim & \\sim & \not\sim & \\not \\sim \cr
  2483. \simeq & \\simeq & \not\simeq & \\not \\simeq
  2484.        & \approx & \\approx & \not\approx & \\not \\approx \cr
  2485. \subset & \\subset & \subseteq & \\subseteq
  2486.         & \supset & \\supset & \supseteq & \\supseteq \cr
  2487. \in & \\in & \ni & \\ni & \parallel & \\parallel & \perp & \\perp \cr
  2488.        }
  2489.  
  2490. \toindex{leq}
  2491. \toindex{geq}
  2492. \toindex{equiv}
  2493. \toindex{sim}
  2494. \toindex{simeq}
  2495. \toindex{approx}
  2496. \toindex{subset}
  2497. \toindex{subseteq}
  2498. \toindex{supset}
  2499. \toindex{supseteq}
  2500. \toindex{in}
  2501. \toindex{ni}
  2502. \toindex{parallel}
  2503. \toindex{perp}
  2504.  
  2505.  
  2506. \exercise
  2507. Typeset: $\vec x\cdot \vec y  = 0$ if and only if $\vec x \perp \vec y$.
  2508.  
  2509. \exercise
  2510. Typeset: $\vec x\cdot \vec y \not= 0$ if and only if $\vec x \not\perp \vec y$.
  2511.  
  2512. Here are some other available mathematical symbols:\TeXref{435--438}
  2513.  
  2514. \maketable [Miscellaneous symbols ]
  2515. \halign{
  2516. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad
  2517.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr
  2518. \noalign{\hrule} \noalign{\smallskip}
  2519. \aleph & \\aleph & \ell & \\ell & \Re & \\Re & \Im & \\Im \cr
  2520. \partial & \\partial & \infty & \\infty & \| & \\| & \angle & \\angle \cr
  2521. \nabla & \\nabla & \backslash &\\backslash & \forall & \\forall
  2522.               & \exists & \\exists \cr
  2523. \neg & \\neg & \flat & \\flat & \sharp & \\sharp & \natural & \\natural \cr
  2524.           }
  2525.  
  2526. \toindex{aleph}
  2527. \toindex{ell}
  2528. \toindex{Re}
  2529. \toindex{Im}
  2530. \toindex{partial}
  2531. \toindex{infty}
  2532. \toindex{|}
  2533. \toindex{angle}
  2534. \toindex{nabla}
  2535. \toindex{backslash}
  2536. \toindex{forall}
  2537. \toindex{exists}
  2538. \toindex{neg}
  2539. \toindex{flat}
  2540. \toindex{sharp}
  2541. \toindex{natural}
  2542.  
  2543. \exercise Typeset: $(\forall x\in \Re)(\exists y\in\Re)$ $y>x$.
  2544.  
  2545. \subsection{Fractions}
  2546.  
  2547. There are two methods of typesetting a fraction: it can be
  2548. typeset either in the form $1/2$ or in the form ${1\over2}$\null.
  2549. The first case is just entered with no special control sequences,
  2550. that is, {\tt \$1/2\$}\null.  The second case uses the control
  2551. word {\tt \\over} and the following pattern: {\tt \lb
  2552. <numerator> \\over <denominator>\rb}\null. Hence {\tt \$\$\lb a+b
  2553. \\over c+d\rb.\$\$} gives \TeXref{139--140}
  2554. \toindex{over} $${a+b\over c+d}.$$
  2555.  
  2556. \exercise Typeset the following: ${a+b\over c}\quad {a\over b+c}
  2557. \quad {1\over a+b+c} \not= {1\over a}+{1\over b}+{1\over c}$.
  2558.  
  2559. \exercise Typeset: What are the points where
  2560. ${\partial \over \partial x} f(x,y) = {\partial \over \partial y}
  2561. f(x,y) = 0$?
  2562.  
  2563. \subsection{Subscripts and superscripts}
  2564.  
  2565. Subscripts and superscripts are particularly easy to enter using
  2566. \TeX\null. The characters {\tt \_{}} and {\tt \^{}} are used to
  2567. indicate that the next character is a subscript or a superscript.
  2568. Thus {\tt \$x\^{}2\$} gives $x^2$ and {\tt \$x\_{}2\$} gives
  2569. $x_2$\null.  To get several characters as a subscript or
  2570. superscript, they are grouped together within braces. Hence we
  2571. can use {\tt \$x\^{}\lb 21\rb\$} to get $x^{21}$ and {\tt \$x\_{}\lb
  2572. 21\rb\$} to get $x_{21}$\null. Notice that the
  2573. superscripts and subscripts are automatically typeset in a
  2574. smaller type size. The situation is only slightly more
  2575. complicated for a second layer of subscripts or superscripts.
  2576. You can {\sl not\/} use {\tt \$x\_{}2\_{}3\$} since this could
  2577. have two possible interpretations, namely, {\tt \$x\_{}\lb 2\_{}3\rb\$}
  2578. or {\tt \$\lb x\_{}2\rb\_{}3\$}; this gives two
  2579. different results: $x_{2_3}$ and ${x_2}_3$, the first of which is
  2580. the usual mathematical subscript notation.  Thus you must put in
  2581. the complete braces to describe multiple layers of subscripts and
  2582. superscripts.  They may be done to any level.
  2583. \TeXref{128--130}
  2584.  
  2585. To use both subscripts and superscripts on one symbol, you use
  2586. both the {\tt \_{}} and {\tt \^{}} in either order.  Thus either
  2587. {\tt \$x\_{}2\^{}1\$} or {\tt\$x\^{}1\_{}2\$} will give $x_2^1$.
  2588.  
  2589. \exercise
  2590. Typeset each of the following: $e^x \quad e^{-x} \quad
  2591. e^{i\pi}+1=0 \quad x_0 \quad x_0^2 \quad {x_0}^2 \quad 2^{x^x}$.
  2592.  
  2593. \exercise Typeset:
  2594. $\nabla^2 f(x,y) = {\partial^2 f \over\partial x^2}
  2595. + {\partial^2 f \over\partial y^2}$.
  2596. \bigskip
  2597.  
  2598. A similar method is used for summations and integrals.  The input
  2599. of {\tt \$\\sum\_{}\lb k=1\rb\^{}n k\^{}2\$} will give $\sum_{k=1}^n
  2600. k^2$, and {\tt \$\\int\_{}0\^{}x f(t) dt\$} will
  2601. give $\int_0^x f(t) dt$.
  2602. \TeXref{144--145}
  2603. \toindex{sum}
  2604. \toindex{int}
  2605.  
  2606. Another use of this type of input is for expressions
  2607. involving limits.  You can use
  2608. {\tt \$\\lim\_\lb n\\to \\infty\rb (\lb n+1 \\over n\rb)\^{}n = e\$}
  2609. to get $\lim_{n\to \infty} ({n+1\over n})^n = e$.
  2610. \toindex{lim}
  2611.  
  2612. \exercise Typeset the following expression: $\lim_{x\to 0}
  2613. (1+x)^{1\over x}=e$.
  2614.  
  2615. \exercise Typeset: The cardinality of $(-\infty, \infty)$ is $\aleph_1$.
  2616.  
  2617. \exercise Typeset: $\lim_{x\to {0^+}} x^x = 1$.
  2618. \bigskip
  2619.  
  2620. Here's a hint to make integrals look a little nicer: look at the
  2621. difference between $\int_0^x f(t) dt$ and $\int_0^x f(t)\, dt$\null.
  2622. In the second case there is a little extra space after
  2623. $f(t)$, and it looks nicer; {\tt \\,} was used to add the
  2624. additional space.
  2625. \toindex{,}
  2626.  
  2627. \exercise Typeset the following integral: $\int_0^1 3x^2\,dx = 1$.
  2628.  
  2629. \subsection{Roots, square and otherwise}
  2630.  
  2631. To typeset a square root it is only necessary to use the construction
  2632. {\tt \\sqrt\lb$\ldots$\rb}\null. Hence {\tt \$\\sqrt\lb x\^{}2+y\^{}2\rb\$}
  2633. will give $\sqrt{x^2+y^2}$\null.  Notice that \TeX{} takes care of the
  2634. placement of symbols and the height and length of the radical.
  2635. To make cube or other roots, the control words {\tt \\root} and {\tt
  2636. \\of} are used.  You get $\root n \of {1+x^n}$ from the
  2637. input\TeXref{130--131} {\tt \$\\root n \\of \lb1+x\^{}n\rb\$}.
  2638. \toindex{root}
  2639. \toindex{sqroot}
  2640.  
  2641. A possible alternative is to use the control word {\tt \\surd}; the
  2642. input {\tt \$\\surd 2\$} will produce $\surd 2$.
  2643. \toindex{surd}
  2644.  
  2645. \exercise Typeset the following: $\sqrt2 \quad \sqrt {x+y\over x-y}
  2646. \quad \root 3 \of {10}$ \quad $e^{\sqrt x}$.
  2647.  
  2648. \exercise Typeset: $\|x\| = \sqrt{x\cdot x}$.
  2649.  
  2650. \exercise Typeset:
  2651. $\phi(t) = {1 \over \sqrt{2\pi}} \int_0^t e^{-x^2/2}\,dx$.
  2652.  
  2653.  
  2654. \subsection{Lines, above and below}
  2655.  
  2656. Use the constructions {\tt \\overline\lb$\ldots$\rb} and
  2657. {\tt \\underline\lb$\ldots$\rb} to put lines above or below mathematical
  2658. expressions. Hence {\tt \$\\overline\lb x+y\rb=\\overline x + \\overline
  2659. y\$} gives $\overline{x+y}=\overline x + \overline y$\null.
  2660. But notice that the lines over the letters are at
  2661. different heights, and so some care is necessary. The use of {\tt
  2662. \\overline\lb\\strut x\rb} will raise the height of the line
  2663. over\TeXref{130--131} $x$\null.
  2664. \toindex{overline}
  2665. \toindex{underline}
  2666.  
  2667. To underline non-mathematical text, use {\tt \\underbar\lb$\dots$\rb}.
  2668. \toindex{underbar}
  2669.  
  2670. \exercise Typeset the following: $\underline x \quad \overline y
  2671. \quad \underline{\overline{x+y}}$.
  2672.  
  2673.  
  2674. \subsection{Delimiters large and small}
  2675.  
  2676. The most commonly used mathematical delimiters are brackets,
  2677. braces, and parentheses.  As we have seen, they may be produced
  2678. by using {\tt [ ] \\\lb\ \\\rb\ ( )} to get
  2679. $[\>]\>\{\>\}\>(\>)\>$. Sometimes larger delimiters increase the
  2680. clarity of mathematical expressions, as in
  2681. $$\bigl(a\times(b+c)\bigr) \bigl((a\times b)+c\bigr).$$ To make
  2682. larger left delimiters the control words {\tt \\bigl}, {\tt
  2683. \\Bigl}, {\tt \\biggl}, and {\tt \\Biggl} are used in front of
  2684. the delimiter; similarly, {\tt \\bigr}, {\tt \\Bigr}, {\tt
  2685. \\biggr}, and {\tt \\Biggr} are used\TeXref{145--147} for the
  2686. right delimiters. Hence {\tt \$\\Bigl[\$} and {\tt \$\\Bigr]\$}
  2687. will produce $\Bigl[$ and $\Bigr]$.
  2688.  
  2689. \toindex{bigl}
  2690. \toindex{Bigl}
  2691. \toindex{biggl}
  2692. \toindex{Biggl}
  2693. \toindex{bigr}
  2694. \toindex{Bigr}
  2695. \toindex{biggr}
  2696. \toindex{Biggr}
  2697.  
  2698. Here is a table to compare the size of some of the delimiters.
  2699.  
  2700. %% \everycr can add 4 points between lines in the following table %%
  2701. \everycr={\noalign{\vskip 4 pt}}
  2702. \maketable [Delimiters of various sizes]
  2703. \halign{
  2704. \strut \hfil$#$ & \quad \tt# \hfil \quad\qquad
  2705.       &\hfil$#$ & \quad \tt# \hfil \quad\qquad
  2706.       &\hfil$#$ & \quad \tt# \hfil \quad\qquad
  2707.       &\hfil$#$ & \quad \tt# \hfil \cr
  2708. \noalign{\hrule} \noalign{\smallskip}
  2709. \{ & \\\lb & \} & \\\rb & ( & ( & ) & )\cr
  2710. \bigl\{ & \\bigl\\\lb & \bigr\} & \\bigr\\\rb & \bigl( & \\bigl( & \bigr) &
  2711. \\bigr)\cr
  2712. \Bigl\{ & \\Bigl\\\lb & \Bigr\} & \\Bigr\\\rb & \Bigl( & \\Bigl( & \Bigr) &
  2713. \\Bigr)\cr
  2714. \biggl\{ & \\biggl\\\lb & \biggr\} & \\biggr\\\rb & \biggl(
  2715.          & \\biggl( & \biggr) & \\biggr) \cr
  2716. \Biggl\{ & \\Biggl\\\lb & \Biggr\} & \\Biggr\\\rb & \Biggl(
  2717.          & \\Biggl( & \Biggr) & \\Biggr)\cr
  2718.        }
  2719.  
  2720. \everycr={}
  2721.  
  2722. If you want, you can let \TeX{} choose the size of delimiter by
  2723. using the control words {\tt \\left} and {\tt \\right} before
  2724. your delimiters.
  2725. \TeXref{148}Thus {\tt \\left[$\ldots$\\right]}  will cause the material
  2726. to be enclosed by brackets that are appropriately big.  {\bf Note
  2727. well:} each use of a {\tt \\left} delimiter must have a matching
  2728. {\tt \\right} delimiter (although the delimiters themselves may be
  2729. different). Hence {\tt \$\$\\left|\lb a+b \\over
  2730. c+d\rb\\right|.\$\$} gives $$\left|{a+b \over c+d}\right|.$$
  2731.  
  2732. \maketable [Mathematical delimiters]
  2733. \halign{
  2734. \strut \hfill$#$ & \quad \tt # \qquad\qquad &
  2735.        \hfill$#$ & \quad \tt # \qquad\qquad &
  2736.        \hfill$#$ & \quad \tt #  \cr
  2737. \noalign{\hrule} \noalign{\smallskip}
  2738. (       & (        & )          & )           & [        & [         \cr
  2739. ]       & ]        &\{          & \\\lb       & \}       & \\\rb     \cr
  2740. \lfloor & \\lfloor &\rfloor     &\\rfloor     & \lceil   & \\lceil   \cr
  2741. \rceil  & \\rceil  &\langle     & \\langle    & \rangle  & \\rangle  \cr
  2742. /       & /        & \backslash & \\backslash &|         & |         \cr
  2743. \|      & \\|      &\uparrow    & \\uparrow   & \Uparrow & \\Uparrow \cr
  2744. \downarrow & \\downarrow & \Downarrow & \\Downarrow
  2745.                         & \updownarrow & \\updownarrow \cr
  2746. \Updownarrow & \\Updownarrow \cr
  2747.        }
  2748.  
  2749. \toindex{lfloor}
  2750. \toindex{rfloor}
  2751. \toindex{lceil}
  2752. \toindex{rceil}
  2753. \toindex{langle}
  2754. \toindex{rangle}
  2755. \toindex{|}
  2756. \toindex{uparrow}
  2757. \toindex{Uparrow}
  2758. \toindex{downarrow}
  2759. \toindex{Downarrow}
  2760. \toindex{updownarrow}
  2761. \toindex{Updownarrow}
  2762.  
  2763. \exercise Typeset $\bigl \lceil \lfloor x \rfloor \bigr \rceil
  2764.               \leq \bigl \lfloor \lceil x \rceil \bigr \rfloor$.
  2765.  
  2766. \subsection{Those special functions}
  2767.  
  2768. There are several types of functions that appear frequently in
  2769. mathematical text.  In an equation like ``$\sin^2x + \cos^2x =
  2770. 1$'' the trigonometric functions ``sin'' and ``cos'' are in roman
  2771. rather than italic type. This is the usual mathematical
  2772. convention to indicate that it is a function being described and
  2773. not the product of three variables.  The control words {\tt
  2774. \\sin} and {\tt \\cos} will use the right typeface automatically.
  2775. Here is a table of these and some other special functions:
  2776. \TeXref{162}
  2777.  
  2778. \maketable [Special mathematical functions]
  2779. \halign{
  2780.    \strut \tt {\\}#\hfil && \quad \tt {\\}#\hfil \cr
  2781.    \noalign{\hrule} \noalign{\smallskip}
  2782.    sin    & cos    & tan  & cot  & sec  & csc & arcsin & arccos \cr
  2783.    arctan & sinh   & cosh & tanh & coth & lim & sup    & inf    \cr
  2784.    limsup & liminf & log  & ln   & lg   & exp & det    & deg    \cr
  2785.    dim    & hom    & ker  & max  & min  & arg & gcd    & Pr     \cr
  2786.        }
  2787.  
  2788. \toindex{sin}
  2789. \toindex{cos}
  2790. \toindex{tan}
  2791. \toindex{cot}
  2792. \toindex{sec}
  2793. \toindex{csc}
  2794. \toindex{arcsin}
  2795. \toindex{arccos}
  2796. \toindex{arctan}
  2797. \toindex{sinh}
  2798. \toindex{cosh}
  2799. \toindex{tanh}
  2800. \toindex{coth}
  2801. \toindex{lim}
  2802. \toindex{sup}
  2803. \toindex{inf}
  2804. \toindex{limsup}
  2805. \toindex{liminf}
  2806. \toindex{log}
  2807. \toindex{ln}
  2808. \toindex{lg}
  2809. \toindex{exp}
  2810. \toindex{det}
  2811. \toindex{deg}
  2812. \toindex{dim}
  2813. \toindex{hom}
  2814. \toindex{ker}
  2815. \toindex{max}
  2816. \toindex{min}
  2817. \toindex{arg}
  2818. \toindex{gcd}
  2819. \toindex{Pr}
  2820.  
  2821. \exercise Typeset: $\sin(2\theta) = 2\sin\theta\cos\theta \quad
  2822. \cos(2\theta) = 2\cos^2\theta - 1  $.
  2823.  
  2824. \exercise Typeset: $$\int \csc^2x\, dx = -\cot x+ C
  2825. \qquad \lim_{\alpha\to 0} {\sin\alpha \over \alpha} = 1
  2826. \qquad \lim_{\alpha\to \infty} {\sin\alpha \over \alpha} = 0.$$
  2827.  
  2828. \exercise Typeset: $$\tan(2\theta) = {2\tan\theta \over
  2829. 1-\tan^2\theta}.$$
  2830.  
  2831.  
  2832. \subsection{Hear ye, hear ye!}
  2833.  
  2834. There is a particular macro that is used in almost every
  2835. mathematical paper, and is different enough to require a special
  2836. explanation. This is the {\tt \\proclaim} macro.  It is used when
  2837. stating theorems, corollaries, propositions, and the like.  The
  2838. paragraph following {\tt \\proclaim} is broken into two parts:
  2839. the first part goes up to and including the first period that is
  2840. followed by a space, and the second part is the rest of the
  2841. paragraph. \TeXref{202--203}The idea is that the first part
  2842. should be something like ``Theorem 1.'' or ``Corollary B.'' The
  2843. second part is the statement of the theorem or corollary.  Here
  2844. is an example:
  2845. \toindex{proclaim}
  2846.  
  2847. \beginliteral
  2848. \proclaim Theorem 1 (H.~G.~Wells). In the country of the blind,
  2849. the one-eyed man is king.
  2850. @endliteral
  2851.  
  2852. \noindent gives
  2853.  
  2854. \proclaim Theorem 1 (H.~G.~Wells). In the country of the blind,
  2855. the one-eyed man is king.
  2856.  
  2857. The statement of the theorem may contain mathematical expressions, of
  2858. course.
  2859.  
  2860. \vfill\eject
  2861. \exercise Typeset:
  2862. \nobreak
  2863. \proclaim Theorem (Euclid). There exist an infinite number of
  2864. primes.
  2865.  
  2866. \exercise Typeset:
  2867. \proclaim Proposition 1.
  2868. $\root n \of {\prod_{i=1}^n X_i} \leq {1 \over n} \sum_{i=1}^n X_i$
  2869. with equality if and only if $X_1=\cdots=X_n$.
  2870.  
  2871. \subsection{Matrices}
  2872.  
  2873. Matrices are typeset using combinations of the alignment
  2874. character {\tt \&} and the control word {\tt \\cr} to indicate
  2875. the end of the line.  Start with {\tt \$\$\\pmatrix\lb$\dots$\rb\$\$}.
  2876. Into the space between the braces go the rows of the matrix, each
  2877. one ended by {\tt \\cr}.  The entries are separated by the
  2878. {\tt \&}\null.  For example the input
  2879. \TeXref{176--178}
  2880.  
  2881. \beginliteral
  2882. $$\pmatrix{
  2883. a & b & c & d \cr
  2884. b & a & c+d & c-d \cr
  2885. 0 & 0 & a+b & a-b \cr
  2886. 0 & 0 & ab  & cd \cr
  2887. }.$$
  2888. @endliteral
  2889.  
  2890. \noindent
  2891. gives as printed output
  2892. $$\pmatrix{
  2893. a & b & c & d \cr
  2894. b & a & c+d & c-d \cr
  2895. 0 & 0 & a+b & a-b \cr
  2896. 0 & 0 & ab  & cd \cr
  2897. }.$$
  2898. \toindex{pmatrix}
  2899.  
  2900. The matrix entries in our examples have all been \centred{}
  2901. within their columns with a little space on each side.  They can
  2902. be made flush right or flush left by inserting {\tt \\hfill}
  2903. before or after the entry. Notice the differences between the
  2904. following example and the previous one.
  2905.  
  2906. \beginliteral
  2907. $$\pmatrix{
  2908. a & b & c \hfill  & \hfill d  \cr
  2909. b & a & c+d      & c-d      \cr
  2910. 0 & 0 & a+b      & a-b      \cr
  2911. 0 & 0 & ab \hfill & \hfill cd \cr
  2912. }.$$
  2913. @endliteral
  2914.  
  2915. \noindent
  2916. gives as printed output
  2917.  
  2918. $$\pmatrix{
  2919. a & b & c \hfill & \hfill d   \cr
  2920. b & a & c+d     & c-d       \cr
  2921. 0 & 0 & a+b     & a-b       \cr
  2922. 0 & 0 & ab \hfill & \hfill cd \cr
  2923. }.$$
  2924.  
  2925.  
  2926. \vbox{
  2927. \exercise Typeset
  2928. $$ I_4 = \pmatrix{ 1 &0 &0 &0 \cr
  2929.                    0 &1 &0 &0 \cr
  2930.                    0 &0 &1 &0 \cr
  2931.                    0 &0 &0 &1 \cr}$$
  2932. }
  2933.  
  2934. It's possible to have matrices that use other delimiters. Using
  2935. {\tt \\matrix} instead of {\tt \\pmatrix} will leave off the
  2936. parentheses, so the delimiters must be explicitly included using
  2937. {\tt \\left} and {\tt \\right}.  Here is how we can change the
  2938. matrix of our first example.
  2939. \toindex{matrix}
  2940. \toindex{left}
  2941. \toindex{right}
  2942.  
  2943. \beginliteral
  2944. $$ \left |
  2945. \matrix{
  2946. a & b & c & d \cr
  2947. b & a & c+d & c-d \cr
  2948. 0 & 0 & a+b & a-b \cr
  2949. 0 & 0 & ab  & cd \cr
  2950. }
  2951. \right | $$
  2952. @endliteral
  2953.  
  2954. \noindent
  2955. gives as printed output
  2956. $$ \left |
  2957. \matrix{
  2958. a & b & c & d \cr
  2959. b & a & c+d & c-d \cr
  2960. 0 & 0 & a+b & a-b \cr
  2961. 0 & 0 & ab  & cd \cr
  2962. }
  2963. \right | $$
  2964.  
  2965. It's even possible to use {\tt \\left.} and {\tt \\right.} to
  2966. indicate that the opening or closing delimiter is deleted (note
  2967. the use of the period).
  2968.  
  2969. \exercise Use a matrix construction to typeset
  2970.  
  2971. $$ |x| = \left\{ \matrix{ x & x \ge 0 \cr
  2972.                          -x & x \le 0 \cr} \right.$$
  2973.  
  2974. This exercise and more general constructions of this type
  2975. may also be typeset using the {\tt \\cases} macro.
  2976. \TeXref{175}
  2977.  
  2978. Sometimes ellipses are used within matrices.  The control words
  2979. {\tt \\cdots}, {\tt \\vdots}, and {\tt \\ddots} can be used to
  2980. insert horizontal, vertical, and diagonal dots.
  2981.  
  2982. Thus we can use
  2983. \beginliteral
  2984. $$ \left [
  2985. \matrix{
  2986. aa     & \cdots & az     \cr
  2987. \vdots & \ddots & \vdots \cr
  2988. za     & \cdots & zz     \cr
  2989. }
  2990. \right ] $$
  2991. @endliteral
  2992.  
  2993. \noindent
  2994. to get as printed output
  2995. $$ \left [
  2996. \matrix{
  2997. aa     & \cdots & az     \cr
  2998. \vdots & \ddots & \vdots \cr
  2999. za     & \cdots & zz     \cr
  3000. }
  3001. \right ] $$
  3002.  
  3003.  
  3004. Matrices may also be typeset in-line, but they are pretty ugly
  3005. unless they have a small number of rows.
  3006.  
  3007.  
  3008. \subsection{Displayed equations}
  3009.  
  3010. All of the mathematics covered so far has identical input whether
  3011. it is to be typeset in-line or displayed.  At this point we'll
  3012. look at some situations that apply to displayed equations only.
  3013.  
  3014. The first is that of aligning multiline displays.  This is done with
  3015. the alignment character {\tt \&} and the control words {\tt \\cr} and
  3016. {\tt \\eqalign}. Starting with {\tt \$\$\\eqalign\lb$\dots$\rb\$\$},
  3017. the equations to be aligned are entered with each one terminated by
  3018. {\tt \\cr}.  In each equation there should be one alignment symbol
  3019. {\tt \&} to indicate where the alignment should take place.  This is
  3020. usually done at the equal signs, although it is not necessary to do
  3021. so.  For example
  3022. \TeXref{190--192}
  3023. \toindex{eqalign}
  3024.  
  3025. \beginliteral
  3026. $$\eqalign{
  3027. a+b &= c+d \cr
  3028. x &= w + y + z \cr
  3029. m + n + o + p &= q \cr
  3030. }$$
  3031. @endliteral
  3032.  
  3033.  
  3034. \noindent
  3035. yields
  3036. $$\eqalign{
  3037. a+b &= c+d \cr
  3038. x &= w + y + z \cr
  3039. m + n + o + p &= q \cr
  3040. }$$
  3041.  
  3042. Displayed equations can be numbered at either the right or left
  3043. margin.  When the control word {\tt \\eqno} appears in a displayed
  3044. equation, everything after the control word is put at the right
  3045. margin.  Hence {\tt \$\$ x+y=z. \\eqno (1)\$\$} yields
  3046. $$ x+y=z. \eqno (1)$$
  3047. To number an equation at the left margin, use {\tt \\leqno}
  3048. in place of {\tt \\eqno}.
  3049. \toindex{eqno}
  3050. \toindex{leqno}
  3051.  
  3052. It's possible to number aligned equations by using the control
  3053. word {\tt \\eqalignno}.  The alignment character {\tt \&} is
  3054. used to separate the equation from the equation number.
  3055. \beginliteral
  3056. $$\eqalignno{
  3057. a+b &= c+d & (1) \cr
  3058. x &= w + y + z \cr
  3059. m + n + o + p &= q & * \cr
  3060. }$$
  3061. @endliteral
  3062.  
  3063. \noindent
  3064. yields
  3065. $$\eqalignno{
  3066. a+b &= c+d & (1) \cr
  3067. x &= w + y + z \cr
  3068. m + n + o + p &= q & * \cr
  3069. }$$
  3070.  
  3071. Use {\tt \\leqalignno} to put the equation numbers on the left.
  3072. \TeXref{192--193}
  3073. \toindex{eqalignno}
  3074. \toindex{leqalignno}
  3075.  
  3076. Finally, suppose some text needs to appear in the middle of a
  3077. displayed equation.  This can be done by putting it in an hbox.
  3078. We will describe hboxes in more detail in the next section.
  3079. For now we want to use them to temporarily resume using ordinary
  3080. roman type and to also allow the insertion of space between
  3081. words (remember that all spaces are ignored when typesetting
  3082. mathematics). Hence
  3083. {\tt \$\$X=Y \\hbox\lb{} if and only if \rb x=y.\$\$} will give
  3084. $$X=Y \hbox{ if and only if } x=y.$$
  3085. Note carefully the spaces in the hbox.
  3086.  
  3087. \exercise Do some of the challenge problems on pages 180--181 of The
  3088. \TeX book.
  3089.  
  3090.  
  3091.  
  3092.  
  3093. \section{All in a row}
  3094.  
  3095. It's not uncommon to want to put a table in the middle of some
  3096. text. Fortunately \TeX{} makes it easy to do this.  In fact there
  3097. are two separate methods of aligning text.  The first is by using
  3098. the tabbing environment.  This is similar to setting the tab
  3099. stops on a typewriter. Each line is handled individually,
  3100. according to set tab columns, but with greater flexibility than
  3101. that provided by a typewriter. The second is the horizontal
  3102. alignment environment which typesets the whole table at once
  3103. using a prescribed pattern.
  3104.  
  3105. \subsection{Picking up the tab}
  3106.  
  3107. To align material using the tabbing environment, you must first
  3108. set the tab positions using the {\tt \\settabs} control word.
  3109. Having done this, a line to use these tabs starts with the
  3110. control symbol {\tt \\+ } and ends with {\tt \\cr } (remember
  3111. that the actual spacing on lines in the input file in
  3112. unimportant). \toindex{settabs}
  3113.  
  3114. The easiest way to use the {\tt \\settabs} control word is to put
  3115. the text into equal columns.
  3116. \TeXref{231}
  3117. Using {\tt \\settabs 4 \\columns} will set the tabs that will
  3118. produce four equal columns.  The tabbing is then done by using
  3119. the alignment character {\tt \&} to move to the next tab stop.
  3120. So, for example, \toindex{columns}
  3121.  
  3122. \beginliteral
  3123. \settabs 4 \columns
  3124. \+ British Columbia & Alberta & Saskatchewan & Manitoba \cr
  3125. \+ Ontario & Quebec & New Brunswick & Nova Scotia \cr
  3126. \+ & Prince Edward Island & Newfoundland \cr
  3127. @endliteral
  3128.  
  3129.  
  3130. \noindent
  3131. will produce the table
  3132. \vskip\baselineskip
  3133.  
  3134. \settabs 4 \columns
  3135. \+ British Columbia & Alberta & Saskatchewan & Manitoba \cr
  3136. \+ Ontario & Quebec & New Brunswick & Nova Scotia \cr
  3137. \+ & Prince Edward Island & Newfoundland \cr
  3138.  
  3139. Notice that it is possible to skip over some tab positions, and
  3140. it is not necessary to use all of the tabs in a given line. To
  3141. make the same table using five columns, it is only necessary to
  3142. use {\tt \\settabs 5 \\columns} to reset the tab stops; then the
  3143. same three lines from the last example will produce:
  3144. \vskip\baselineskip
  3145.  
  3146. \settabs 5 \columns
  3147. \+ British Columbia & Alberta & Saskatchewan & Manitoba \cr
  3148. \+ Ontario & Quebec & New Brunswick & Nova Scotia \cr
  3149. \+ & Prince Edward Island & Newfoundland \cr
  3150.  
  3151. In this example, the columns are smaller, of course.  In fact
  3152. there are two overlapping entries in the last row.  This is
  3153. because \TeX{} will tab to the next tab position even if (unlike
  3154. a typewriter) it means going backward on the page.
  3155.  
  3156. There is an interesting relationship between grouping and
  3157. tabbing. The {\tt \\settabs} values are only applicable to the
  3158. group in which it is defined, as would be expected.  Thus it is
  3159. possible to temporarily change the tab settings by grouping
  3160. within braces.  In addition, each table entry is in a group of
  3161. its own. Hence we may make a single entry boldface, for example,
  3162. by using {\tt \\bf}  without braces. In addition, for any column
  3163. but the last one it is possible to \centre{} the entry or to
  3164. align it either on the left or on the right, or to fill a column
  3165. with a line or dots. Each entry has an implicit {\tt \\hfil} at
  3166. the end so that it will be at the left of the column by default.
  3167. Adding {\tt \\hfil} at the beginning of the entry will then cause
  3168. it to be \centred{}, just as with the {\tt \\line} control word.
  3169. Adding {\tt \\hfill} to the beginning will cause the entries to
  3170. be pushed to the right ({\tt \\hfill} acts just like {\tt \\hfil}
  3171. in that it absorbs excess space; when both {\tt \\hfil} and {\tt
  3172. \\hfill} appear, the {\tt \\hfill} takes precedence).
  3173. \toindex{hfill}
  3174.  
  3175. \beginliteral
  3176. \settabs 4 \columns
  3177. \+ \hfil British Columbia & \hfill Alberta \qquad & \bf Saskatchewan
  3178. @hskip 2.5in                                  & Manitoba \cr
  3179. \+ \hfil Ontario & \hfill Quebec \qquad & \bf New Brunswick
  3180. @hskip 2.5in                                 & Nova Scotia \cr
  3181. \+ \hfil ---  & \hfill * \qquad & \bf Newfoundland
  3182. @hskip 2.5in          & Prince Edward Island \cr
  3183. \+ \dotfill && \hrulefill & \cr
  3184. @endliteral
  3185.  
  3186. \noindent
  3187. will produce a table with the first column \centred{}, the second
  3188. column flush right with a {\tt \\qquad} of padding, and the third
  3189. column boldface. The control words {\tt \\dotfill} and {\tt \\hrulefill}
  3190. give alternative column entries.
  3191. \toindex{dotfill}
  3192. \toindex{hrulefill}
  3193. \vskip\baselineskip
  3194.  
  3195. \settabs 4 \columns
  3196. \+ \hfil British Columbia & \hfill Alberta \qquad & \bf Saskatchewan
  3197.                                         & Manitoba \cr
  3198. \+ \hfil Ontario & \hfill Quebec \qquad & \bf New Brunswick
  3199.                                         & Nova Scotia \cr
  3200. \+ \hfil ---  & \hfill * \qquad & \bf Newfoundland &
  3201.                       Prince Edward Island \cr
  3202. \+ \dotfill && \hrulefill & \cr
  3203.  
  3204. \exercise Take the table of Canadian provinces above and \centre{} each
  3205. entry within its column.
  3206.  
  3207. The tab positions can be set with much more flexibility than just
  3208. in equal columns.  The general pattern is to use a sample line of
  3209. the form {\tt \\settabs \\+ $\ldots$ \& $\ldots$ \& $\ldots$ \\cr}.
  3210. The spacing between the alignment characters {\tt \&}
  3211. determines the position of the tabs.  For example, {\tt \\settabs
  3212. \\+ \\hskip 1 in \& \\hskip 2 in \& \\hskip 1.5 in \& \\cr} would
  3213. set the first tab one inch from the left margin, the next another
  3214. two inches further in, and the third 1.5 inches more.  It's also
  3215. possible to use text to determine the distance between tabs. So,
  3216. for example, another possible sample line is
  3217. {\tt \\settabs \\+ \\quad Province \\quad \& \\quad Population \\quad
  3218. \& \\quad Area \\quad \& \\cr}.
  3219. The tab column would then be just wide enough to accept the headings
  3220. with a quad of space on each side.  Here's a more complete example:
  3221.  
  3222. \beginuser \obeyspaces
  3223. \\settabs \\+ \\quad Year \\quad \& \\quad Price \\quad
  3224.                                             \& \\quad Dividend \& \\cr
  3225. \\+ \\hfill Year \\quad \& \\quad Price  \\quad \& \\quad Dividend \\cr
  3226. \\+ \\hfill 1971 \\quad \& \\quad 41--54 \\quad \& \\qquad \\\$2.60 \\cr
  3227. \\+ \\hfill 2    \\quad \& \\quad 41--54 \\quad \& \\qquad \\\$2.70 \\cr
  3228. \\+ \\hfill 3    \\quad \& \\quad 46--55 \\quad \& \\qquad \\\$2.87 \\cr
  3229. \\+ \\hfill 4    \\quad \& \\quad 40--53 \\quad \& \\qquad \\\$3.24 \\cr
  3230. \\+ \\hfill 5    \\quad \& \\quad 45--52 \\quad \& \\qquad \\\$3.40 \\cr
  3231. \enduser
  3232.  
  3233. \noindent
  3234. gives \TeXref{247}
  3235. \vskip\baselineskip
  3236.  
  3237. \settabs \+ \quad Year \quad & \quad Price \quad & \quad
  3238. Dividend \quad & \cr
  3239. \+ \hfill Year \quad & \quad Price  \quad & \quad Dividend \cr
  3240. \+ \hfill 1971 \quad & \quad 41--54 \quad & \qquad \$2.60   \cr
  3241. \+ \hfill 2    \quad & \quad 41--54 \quad & \qquad \$2.70 \cr
  3242. \+ \hfill 3    \quad & \quad 46--55 \quad & \qquad \$2.87 \cr
  3243. \+ \hfill 4    \quad & \quad 40--53 \quad & \qquad \$3.24 \cr
  3244. \+ \hfill 5    \quad & \quad 45--52 \quad & \qquad \$3.40 \cr
  3245.  
  3246. \exercise Take the table given above and move it closer to the
  3247. \centre{} of the page.
  3248.  
  3249. \exercise One way to \centre{} a block of text, possibly several
  3250. lines long, is to use: {\tt \$\$\\vbox\lb$\ldots$\rb\$\$}. Use
  3251. this to \centre{} the table given above.  Does the
  3252. {\tt \\settabs} line need to be included in the {\tt \\vbox}?
  3253.  
  3254. \exercise Improve your last result by putting a line under the
  3255. column heads.  The control word {\tt \\hrule} will insert a
  3256. horizontal line if introduced between two rows of a table.  Now
  3257. repeat with the control word {\tt \\strut} after the {\tt \\+ }
  3258. of the line containing the column heads. (A {\tt \\strut}
  3259. effectively makes the spacing between lines a little greater. The
  3260. size can be altered from the default.)\TeXref{82} Note the extra
  3261. space that results.
  3262. \toindex{strut}
  3263.  
  3264. \exercise Make the following table with decimal alignment, that
  3265. is, with the decimal points above each other (think of the dollar
  3266. figure as being right aligned and the cents figure as being left
  3267. aligned against the decimal point):
  3268. \medskip
  3269. \settabs \+ \hskip 2 in & \hskip .75in & \hskip 1cm& \cr
  3270. \+ &Plums &\hfill\$1&.22 \cr
  3271. \+ &Coffee &\hfill1&.78 \cr
  3272. \+ &Granola &\hfill1&.98 \cr
  3273. \+ &Mushrooms & &.63 \cr
  3274. \+ &{Kiwi fruit} & &.39 \cr
  3275. \+ &{Orange juice} &\hfill1&.09 \cr
  3276. \+ &Tuna &\hfill1&.29 \cr
  3277. \+ &Zucchini & &.64 \cr
  3278. \+ &Grapes &\hfill1&.69 \cr
  3279. \+ &{Smoked beef} & &.75 \cr
  3280. \+ &Broccoli &\hfill\underbar{\ \ 1}&\underbar{.09} \cr
  3281. \+ &Total &\hfill \$12&.55 \cr
  3282.  
  3283.  
  3284. \exercise Devise a method to make a rough table of contents by using
  3285. {\tt \\settabs} and having entries looking something like:\hfil\break
  3286. \leftline{\tt Getting Started \\dotfill \& \\hfill 1}
  3287. \leftline{\tt All Characters Great and Small \\dotfill \& \\hfill 9.}
  3288.  
  3289. \subsection{Horizontal alignment with more sophisticated patterns}
  3290.  
  3291. The {\tt \\settabs} environment is not difficult to use, and once
  3292. the pattern is set, it can be used repeatedly in different
  3293. portions of the text that follows.  It does have some drawbacks,
  3294. however. For one, the column size must be set before the entries
  3295. are known. Also, even though in one case we wanted the third
  3296. column to be boldface, it had to be specified in each line.
  3297. These problems can be handled more easily by using the {\tt
  3298. \\halign} environment.
  3299. \TeXref{235--238}
  3300. \toindex{halign}
  3301.  
  3302.  
  3303. The general pattern in the {\tt \\halign} is as follows:
  3304. \beginuser
  3305. \\halign\lb{} <template line> \\cr
  3306. <first display line> \\cr
  3307. <second display line> \\cr
  3308. $\vdots$
  3309. <last display line> \\cr
  3310. \rb
  3311. \enduser
  3312.  
  3313. Both the template line and the display lines are divided into
  3314. sections by the alignment symbol {\tt \&}\null. In the template
  3315. line each section uses control words in the same manner as does
  3316. {\tt \\line\lb\rb}\null.  The control word {\tt \\hfil}, for
  3317. example, can be used to display flush left, flush right, or \centred.
  3318. Fonts can be changed using {\tt \\bf}, {\tt \\it}, etc.
  3319. Text may also be entered in the template line.  In addition the
  3320. special symbol {\tt \#} must appear once in each section.  Each
  3321. display line is then set by substituting each section of the
  3322. display line into its corresponding section of the template line
  3323. at the occurrence of the {\tt \#}\null.
  3324.  
  3325. Consider the following example:
  3326.  
  3327. \beginuser
  3328. \\halign\lb\\hskip 2 in \$\#\$\& \\hfil \\quad \# \\hfil \& \\qquad \$\#\$
  3329.        \hskip 3in \& \\hfil \\quad \# \\hfil \\cr
  3330. \\alpha   \& alpha   \& \\beta  \& beta  \\cr
  3331. \\gamma   \& gamma   \& \\delta \& delta \\cr
  3332. \\epsilon \& epsilon \& \\zeta  \& zeta  \\cr
  3333. \rb
  3334. \enduser
  3335.  
  3336. \noindent The template line indicates that the first section of
  3337. the typeset text will always be set two inches in from the left
  3338. and also be set as mathematics.  The second section will be \centred{}
  3339. after adding a quad of space on the left.  The third
  3340. and fourth sections are handled similarly.  Here is the result:
  3341. \vskip\baselineskip
  3342.  
  3343. \halign{\hskip 2in $#$& \hfil\quad # \hfil & \qquad $#$
  3344.                        & \hfil\quad # \hfil\cr
  3345. \alpha   & alpha   & \beta  & beta \cr
  3346. \gamma   & gamma   & \delta & delta \cr
  3347. \epsilon & epsilon & \zeta  & zeta \cr
  3348. }
  3349.  
  3350. In this case the first display line is formed by substituting {\tt
  3351. \\alpha} for the first {\tt \#} in the template line, {\tt alpha} for
  3352. the second {\tt \#}, {\tt \\beta} for the third and {\tt beta} for
  3353. the fourth.  The whole line is then saved for setting.  This
  3354. continues until all the lines are accumulated, and then they are set
  3355. with each column being as wide as necessary to accept all of its
  3356. entries (an implication of this accumulation process is that a table
  3357. with too many entries could cause \TeX{} to run out of memory; it's
  3358. better not to set tables that are more than a page or so long).
  3359.  
  3360. Hence the template line establishes the pattern for the table entries
  3361. and the display lines insert the individual entries.
  3362.  
  3363. Sometimes horizontal and vertical lines are used to delimit
  3364. entries in a table.  To put in horizontal lines, we use {\tt \\hrule},
  3365. just as we did in the {\tt \\settabs} environment.
  3366. However, we don't want the rule to be aligned according to the
  3367. template, so we use the control word {\tt \\noalign}.  Hence
  3368. horizontal lines are inserted by putting {\tt \\noalign\lb\\hrule\rb};
  3369. vertical lines are inserted by putting {\tt \\vrule}
  3370. in either the template or the display line. But still all is not
  3371. completely straightforward.  Suppose we take our last example and
  3372. change the template to get vertical lines and also insert
  3373. horizontal lines.
  3374. \toindex{noalign}
  3375.  
  3376. \beginuser
  3377. \\halign\lb\\hskip 2in\\vrule\\quad \$\#\$\\quad \& \\vrule \\hfil\\quad %
  3378. \# \\hfil
  3379. \hskip 2 in \& \\quad \\vrule \\quad \$\#\$\\quad
  3380. \hskip 2 in \& \\vrule\\hfil \\quad \# \\quad \\hfil \\vrule \\cr
  3381. \\noalign\lb\\hrule\rb
  3382. \\alpha   \& alpha   \& \\beta  \& beta \\cr
  3383. \\noalign\lb\\hrule\rb
  3384. \\gamma   \& gamma   \& \\delta \& delta \\cr
  3385. \\noalign\lb\\hrule\rb
  3386. \\epsilon \& epsilon \& \\zeta  \& zeta \\cr
  3387. \\noalign\lb\\hrule\rb
  3388. \rb
  3389. \enduser
  3390.  
  3391. \noindent
  3392. doesn't give exactly what we want.
  3393.  
  3394. \vskip\baselineskip
  3395.  
  3396. \halign{\hskip 2in\vrule\quad $#$\quad & \vrule \hfil\quad # \hfil
  3397. & \quad \vrule \quad $#$\quad & \vrule \hfil\quad # \quad \hfil
  3398. \vrule \cr
  3399. \noalign{\hrule}
  3400. \alpha   & alpha   & \beta  & beta \cr
  3401. \noalign{\hrule}
  3402. \gamma   & gamma   & \delta & delta \cr
  3403. \noalign{\hrule}
  3404. \epsilon & epsilon & \zeta  & zeta \cr
  3405. \noalign{\hrule}
  3406. }
  3407.  
  3408. There are several deficiencies: the most obvious is the extended
  3409. horizontal lines, but also the text looks somewhat squashed into
  3410. the boxes.  In addition, the text has a little extra space on the
  3411. right rather than being perfectly \centred. As in the {\tt \\settabs}
  3412. environment, lines can be made taller by including the control
  3413. word {\tt \\strut} in the template.\TeXref{82} A further problem
  3414. can occur when the page is set since \TeX{} may spread lines
  3415. apart slightly to improve the appearance of the page.  This would
  3416. leave a gap between the vertical lines, so we use the control
  3417. word {\tt \\offinterlineskip} within the {\tt \\halign} to avoid
  3418. this.  Finally we can get rid of the lines sticking out on the
  3419. left by deleting the {\tt \\hskip 2 in} from the template line.
  3420. To move the table to the same position we use {\tt \\moveright}.
  3421. Finally, we can see how to \centre{} the text by noting that the
  3422. extra space occurs in the template line after the {\tt \#} where
  3423. the text is inserted.
  3424. Hence we can improve our result by using
  3425. \toindex{offinterlineskip}
  3426. \toindex{moveright}
  3427.  
  3428. \beginuser
  3429. \\moveright 2 in
  3430. \\vbox\lb\\offinterlineskip
  3431.  
  3432. \\halign\lb\\strut \\vrule \\quad \$\#\$\\quad \&\\vrule \\hfil \\quad %
  3433. \#\\quad \\hfil
  3434. \&\\vrule \\quad \$\#\$\\quad \&\\vrule \\hfil \\quad \#\\quad \\hfil %
  3435. \\vrule \\cr
  3436. \\noalign\lb\\hrule\rb
  3437. \\alpha   \& alpha   \& \\beta  \& beta \\cr
  3438. \\noalign\lb\\hrule\rb
  3439. \\gamma   \& gamma   \& \\delta \& delta \\cr
  3440. \\noalign\lb\\hrule\rb
  3441. \\epsilon \& epsilon \& \\zeta  \& zeta \\cr
  3442. \\noalign\lb\\hrule\rb
  3443. \rb\rb
  3444. \enduser
  3445.  
  3446. \noindent
  3447. to get
  3448. \vskip\baselineskip
  3449.  
  3450. \moveright 2 in
  3451. \vbox{\offinterlineskip
  3452. \halign{\strut \vrule \quad $#$\quad &\vrule \hfil \quad #\quad \hfil
  3453. &\vrule \quad $#$\quad &\vrule \hfil \quad #\quad \hfil
  3454. \vrule \cr
  3455. \noalign{\hrule}
  3456. \alpha   & alpha   & \beta  & beta \cr
  3457. \noalign{\hrule}
  3458. \gamma   & gamma   & \delta & delta \cr
  3459. \noalign{\hrule}
  3460. \epsilon & epsilon & \zeta  & zeta \cr
  3461. \noalign{\hrule}
  3462. }
  3463. }
  3464.  
  3465.  
  3466.  
  3467. In general, if we want to construct a table with boxed entries
  3468. that is \centred{} on the page, we can do so by putting the {\tt
  3469. \\vbox} within a {\tt \\centerline\lb\rb}\null. But here is a
  3470. trick that will produce a nicer result.  If the {\tt \\vbox} is
  3471. put in between double dollar signs, it will be typeset as
  3472. displayed mathematics.  Of course, there is no actual
  3473. mathematics being displayed, but \TeX{} will put in a little
  3474. extra space above and below the table as is appropriate for a
  3475. display.  Hence a \centred{} table with this nice spacing may be
  3476. formed using the following four steps:
  3477. (1) put a {\tt \\vbox} between double dollar signs,
  3478. (2) put an {\tt \\offinterlineskip} and an {\tt \\halign} within
  3479. the {\tt \\vbox},
  3480. (3) in the {\tt \\halign} put a template line with a {\tt \\strut}
  3481. in the beginning,  and a {\tt \\vrule} surrounding each entry,
  3482. (4) each row of the table should be preceded and followed by
  3483. {\tt \\noalign\lb\\hrule\rb}.
  3484.  
  3485. Here is the pattern to be followed:
  3486.  
  3487. \beginuser
  3488. \$\$\\vbox\lb
  3489. \\offinterlineskip
  3490. \\halign\lb
  3491. \\strut \\vrule \# \& \\vrule \# \& \dots \& \\vrule \# \\vrule \\cr
  3492. \\noalign\lb\\hrule\rb
  3493. <first column entry> \& <second column entry> \& \dots %
  3494. \& <last column entry> \\cr
  3495. \\noalign\lb\\hrule\rb
  3496. \dots
  3497. \\noalign\lb\\hrule\rb
  3498. <first column entry> \& <second column entry> \& \dots %
  3499. \& <last column entry> \\cr
  3500. \\noalign\lb\\hrule\rb
  3501. \rb
  3502. \rb\$\$
  3503. \enduser
  3504.  
  3505.  
  3506.  
  3507. \section{Rolling your own}
  3508.  
  3509. In this section we'll create new control words.  The making of
  3510. these new definitions, also called macros, is one of the most
  3511. powerful techniques available in \TeX\null.  For the first
  3512. application of this facility, we'll see how a new definition can
  3513. save a lot of typing by substituting short strings for long ones.
  3514.  
  3515. \subsection{The long and short of it}
  3516.  
  3517. The control word {\tt \\def} is used to define new control words.
  3518. The simplest form for doing this is {\tt \\def\\newname\lb$\ldots$\rb}.
  3519. Then whenever {\tt \\newname} appears in your
  3520. input file, it will be replaced by whatever is between the braces
  3521. in the definition.  Of course {\tt \\newname} must satisfy the
  3522. convention for naming control sequences, that is, it must be a
  3523. control word (all letters) or a control symbol (exactly one
  3524. nonletter). So, for example, suppose you write a document that
  3525. contains the phrase ``University of Manitoba'' many times.  Then
  3526. {\tt \\def\\um\lb University of Manitoba\rb} defines a new
  3527. control sequence {\tt \\um} which can then be used at any time.
  3528. The sentence {\tt I take courses at the \\um.}\ then makes
  3529. sense. If the control word exists, your new definition will
  3530. replace it (this includes the control words defined by \TeX{}, so
  3531. a little care must be taken in the choice of name). Any
  3532. definition is, however,  local to the group in which it is
  3533. defined.  For example, \toindex{def}
  3534.  
  3535. \beginuser
  3536. \\def\\um\lb University of Manitoba\rb
  3537. I took my first course at the \\um.
  3538. \lb
  3539. \\def\\um\lb Universit\\'e de Montr\\'eal\rb
  3540. Then I took my next course at the \\um.
  3541. \rb
  3542. Finally I took my last course at the \\um.
  3543. \enduser
  3544.  
  3545. \noindent gives \medskip
  3546.  
  3547. \def\um{University of Manitoba}
  3548. I took my first course at the \um.
  3549. {
  3550. \def\um{Universit\'e de Montr\'eal}
  3551. Then I took my next course at the \um.
  3552. }
  3553. Finally I took my last course at the \um.
  3554.  
  3555. Remember that all spaces after a control word are absorbed; this
  3556. includes the control words that you define. In the previous
  3557. example, any space after {\tt \\um} would be ignored. However,
  3558. the space after the first period and the space after the first
  3559. opening brace are different; if you look closely at the end of
  3560. the first sentence typeset using the example, you'll see some
  3561. extra space. This can be eliminated by putting a {\tt \%} after
  3562. the opening brace to make the rest of the line a comment. The
  3563. same holds for the line with the last closing brace. Careful
  3564. control of spaces often calls for the ``commenting out'' of the
  3565. end of lines in this manner.
  3566.  
  3567. Once a new control sequence has been defined, it may be used in
  3568. new definitions. This is one way of making simple form letters.
  3569. First let's define a simple letter.
  3570.  
  3571. \beginuser
  3572. \\def\\letter\lb
  3573. \\par \\noindent
  3574. Dear \\name,
  3575. \
  3576. This is a little note to let you know that your name is \\name.
  3577. \
  3578. \\hskip 2 in Sincerely yours,
  3579. \\vskip 2\\baselineskip
  3580. \\hskip 2 in The NameNoter
  3581. \\smallskip \\hrule
  3582. \rb
  3583. \enduser
  3584.  
  3585. \def\letter{
  3586. \par \noindent
  3587. Dear \name,
  3588.  
  3589. This is a little note to let you know that your name is \name.
  3590.  
  3591. \hskip 2 in Sincerely yours,
  3592. \vskip 2\baselineskip\nobreak
  3593. \hskip 2 in The NameNoter
  3594. \smallskip \hrule
  3595. }
  3596.  
  3597. Now this letter uses the control word {\tt \\name}, which is
  3598. undefined at this point.  When {\tt \\letter} is used, the
  3599. current value of {\tt \\name} will appear in the body of the
  3600. letter. Hence
  3601.  
  3602. \beginuser
  3603. \\def\\name\lb Michael Bishop\rb
  3604. \\letter
  3605. \\def\\name\lb Michelle L\\'ev\\\^{}eque\rb
  3606. \\letter
  3607. \enduser
  3608.  
  3609. \noindent will produce two copies of the letter, each with the
  3610. correct name, followed by a horizontal rule:
  3611.  
  3612. \def\name{Michael Bishop}
  3613. \letter
  3614. \goodbreak
  3615. \def\name{Michelle L\'ev\^eque}
  3616. \letter
  3617.  
  3618. We could have put anything between the braces in
  3619. {\tt \\def\\name\lb$\ldots$\rb}; it could be several paragraphs
  3620. long and use other control sequences (although in this context it
  3621. would be a little strange). Of course it is possible to use {\tt
  3622. \\vfill \\eject} as part of the definition of {\tt \\letter} to
  3623. eject the page when the letter is completed.
  3624.  
  3625. \exercise Make a form letter that uses the control words {\tt \\name},
  3626. {\tt \\address}, {\tt \\city}, {\tt \\\province}, and {\tt
  3627. \\\postcode}.
  3628.  
  3629. \exercise An unnumbered list of items is often made
  3630. using {\tt \\item\lb\$\\bullet\$\rb}.  Define a macro {\tt \\bitem}
  3631. that does this, and use it for several paragraphs. Now change
  3632. each bullet to a dash (note that a simple change in the macro
  3633. propagates all the necessary changes in all of the paragraphs).
  3634.  
  3635. \exercise Suppose that you are going to have to format several
  3636. paragraphs in a paper using {\tt \\hangindent = 30 pt}, {\tt \\hangafter
  3637. = 4}, and {\tt \\filbreak} (don't worry about what
  3638. these control sequences actually do; the only important thing
  3639. for now is that once they are set, they remain in effect for only
  3640. one paragraph).  Define a single control sequence {\tt \\setpar}
  3641. which can then be put in front of each paragraph that needs to be
  3642. so formatted.
  3643.  
  3644.  
  3645. \subsection{Filling in with parameters}
  3646.  
  3647. It's possible to use macros in much greater generality by
  3648. allowing parameters to be passed.  The idea is somewhat similar
  3649. to the template line in the {\tt \\halign} environment.  First,
  3650. let's look at the case where there is one parameter.  In this
  3651. case a control sequence is defined by {\tt \\def\\newword\#1\lb
  3652. $\ldots$\rb}\null.  The symbol {\tt \#1} may appear between the
  3653. braces (several times) in the definition of {\tt \\newword}.  The
  3654. material between the braces acts like a template. When {\tt
  3655. \\newword\lb$\ldots$\rb} appears in the text, it will use the
  3656. definition of {\tt \\newword} with the material between the
  3657. braces inserted into the template at every occurrence of {\tt
  3658. \#1} in the original definition. {\bf The spacing in the original
  3659. definition is crucial here; there must be no spaces before the
  3660. opening brace}.
  3661.  
  3662. As an example, we could use the form letter of the last section in
  3663. the following way:
  3664.  
  3665.  
  3666. \beginuser
  3667. \\def\\letter\#1\lb
  3668. \\par \\noindent
  3669. Dear \#1,
  3670. \vskip\baselineskip
  3671. This is a little note to let you know that your name is \#1.
  3672. \vskip\baselineskip
  3673. \\hskip 2 in Sincerely yours,
  3674. \\vskip 2\\baselineskip
  3675. \\hskip 2 in The NameNoter
  3676. \\smallskip \\hrule
  3677. \rb
  3678. \enduser
  3679.  
  3680. \def\letter#1{
  3681. \par \noindent
  3682. Dear #1,
  3683.  
  3684. This is a little note to let you know that your name is #1.
  3685.  
  3686. \hskip 2 in Sincerely yours,
  3687. \vskip 2\baselineskip
  3688. \hskip 2 in The NameNoter
  3689. \smallskip \hrule
  3690. }
  3691.  
  3692. Now we can use
  3693.  
  3694. \beginuser
  3695. \\letter\lb Michael Bishop\rb
  3696. \\letter\lb Michelle L\\'ev\\\^{}eque\rb
  3697. \enduser
  3698.  
  3699. \noindent to get \medskip
  3700. \letter{Michael Bishop}
  3701. \goodbreak
  3702. \letter{Michelle L\'ev\^eque}
  3703.  
  3704. \def\displaytext#1{$$\vbox{\hsize=12cm #1}$$}
  3705. \bigskip
  3706. \displaytext{
  3707. Now let's define
  3708. {\tt\\def\\displaytext\#1\lb \$\$\\vbox\lb\\hsize = 12 cm \#1\rb\$\$\rb}
  3709. as a new macro to display text.
  3710. Then {\tt \\displaytext\lb$\ldots$\rb} will cause the material
  3711. between the braces to be put in a paragraph with width 12 \centimetre
  3712. s and then \centred{} with some space added above and
  3713. below as is appropriate for a display.  This paragraph was set
  3714. using this {\tt \\displaytext} macro.
  3715. }
  3716.  
  3717. The parameter of a macro can be no more than one paragraph long.
  3718. If a new paragraph is encountered as part of a parameter, an
  3719. error will be generated.  This is a safety feature, for
  3720. otherwise the accidental omission of a closing brace would cause
  3721. \TeX{} to eat up the rest of the file as the parameter.
  3722.  
  3723. \exercise Define a macro {\tt \\yourgrade} so that {\tt
  3724. \\yourgrade\lb89\rb} will cause the following sentence to be
  3725. typeset: The grade you received is 89\%\null. It should be able
  3726. to work with any other percentage, of course.
  3727. \medbreak
  3728.  
  3729. It's not really any harder to use more than one parameter.  The form
  3730. used to define a new control word with two parameters is
  3731. {\tt \\def\\newword\#1\#2\lb$\ldots$\rb}. The definition between the
  3732. braces may have {\tt \#1} and {\tt \#2} occurring in it, perhaps
  3733. several times.  When {\tt \\newword\lb$\ldots$\rb\lb$\ldots$\rb}
  3734. appears in the text, the material between the first set of braces
  3735. replaces {\tt \#1} in the definition and the material between the
  3736. second set of braces replaces {\tt \#2} in the definition.  Here is
  3737. an example followed by its result:
  3738.  
  3739. \beginuser
  3740. \\def\\talks\#1\#2\lb \#1 talks to \#2.\rb
  3741. \\talks\lb John\rb\lb Jane\rb
  3742. \\talks\lb Jane\rb\lb John\rb
  3743. \\talks\lb John\rb\lb me\rb
  3744. \\talks\lb She\rb\lb Jane\rb
  3745. \enduser
  3746.  
  3747. \def\talks#1#2{#1 talks to #2.}
  3748. \talks{John}{Jane}
  3749. \talks{Jane}{John}
  3750. \talks{John}{me}
  3751. \talks{She}{Jane}
  3752.  
  3753. \exercise In a manner similar to the previous exercise, define a
  3754. macro {\tt \\yourgrade} so that {\tt \\yourgrade\lb89\rb\lb85\rb}
  3755. causes the following sentence to be typeset: You received a grade
  3756. of 89\% on your first exam and a grade of 85\% on your second
  3757. exam.
  3758.  
  3759. \exercise Write a macro {\tt \\frac} so that {\tt \\frac\lb
  3760. a\rb\lb b\rb} will typeset the fraction ${a\over b}$.
  3761.  
  3762. \bigskip
  3763. It's important not to put any spaces before the first brace in
  3764. the definition. If you do, \TeX{} will interpret the definition
  3765. differently from the way described here. For more than two
  3766. parameters, the method of definition is similar. To define a
  3767. control word with three parameters, start with
  3768. {\tt \\def\\newword\#1\#2\#3\lb$\ldots$\rb}. Then {\tt \#1},
  3769. {\tt \#2} and {\tt \#3} may occur between the braces. When
  3770. {\tt \\newword\lb$\ldots$\rb\lb$\ldots$\rb\lb$\ldots$\rb}
  3771. appears in the text, the material between each set of braces
  3772. replaces its corresponding symbol in the definition of the
  3773. control word. The parameters may go up to {\tt \#9}.
  3774.  
  3775. \subsection{By any other name}
  3776.  
  3777. Sometimes it's convenient to be able to give a control word an
  3778. alternative name.  For example, if you prefer a different spelling,
  3779. you might want to call the control word {\tt \\centerline} by the
  3780. name of {\tt \\centreline}.  This can be done by using the {\tt
  3781. \\let} control word.  The use of {\tt \\let \\centreline =
  3782. \\centerline} now makes a new (as well as the old) control word
  3783. available.  This can also be used with mathematical names as with
  3784. {\tt \\let \\tensor = \\otimes}.  It is then possible to use
  3785. \TeXref{206--207}
  3786.  
  3787. \toindex{let}
  3788. \toindex{centreline}
  3789. \toindex{tensor}
  3790.  
  3791. \let\tensor=\otimes
  3792. \beginuser
  3793. \$\$ (A \\tensor B) (C \\tensor D) = AC \\tensor BD. \$\$
  3794. \enduser
  3795.  
  3796. \noindent to get
  3797.  
  3798. $$ (A \tensor B) (C \tensor D) = AC \tensor BD. $$
  3799.  
  3800.  
  3801.  
  3802. \exercise Define control sequences {\tt \\ll}, {\tt \\cl}, and
  3803. {\tt \\rl} that are equivalent to {\tt \\leftline}, {\tt \\centerline},
  3804. and {\tt \\rightline}.
  3805.  
  3806. The {\tt \\let} control word allows users to name their own
  3807. control sequences.  This allows a personalized set of control
  3808. sequences that may be used in place of the ones provided by \TeX{}
  3809. when desired.
  3810.  
  3811. \section{To err is human}
  3812.  
  3813. In some ways \TeX{} is not completely divine. \TeX{} will respond
  3814. to invalid input by giving an error message to the screen if you
  3815. are using it interactively and also to the log file.  Because
  3816. \TeX{} is very complicated, the actual point where the error is
  3817. detected may be deep within the program, so a full report of the
  3818. error may be rather long and involved.    Not only that, \TeX{}
  3819. will try to recover from errors, and will report what was done in
  3820. that process.  For this reason the reading of error messages may
  3821. be a little difficult for the uninitiated.  The key is to know
  3822. what is important from your perspective and what can be safely
  3823. ignored. So let's look at some typical errors and the messages
  3824. that they generate.
  3825.  
  3826. \subsection{The forgotten bye}
  3827.  
  3828. The first mistake that we'll look at is one that everyone makes
  3829. at some time, namely, the omission of {\tt \\bye} at the end of
  3830. the file. If you're using \TeX{} interactively, an asterisk \hfil
  3831. \break
  3832. \leftline{\tt *}
  3833. will be printed on the screen and nothing will happen since,
  3834. having not been told to finish up,  \TeX{} is waiting for input
  3835. (from your keyboard).  Whatever you type in will be appended to
  3836. whatever has been input from your files.  The usual response is
  3837. to type {\tt \\bye<CR>}\fnote{{\tt <CR>} is the key
  3838. used to end a line of input.  It might be called the carriage
  3839. return, enter, or simply the return key on your terminal.
  3840. Sometimes it is indicated by a large left arrow.} since that will
  3841. finish things up.
  3842.  
  3843. \subsection{The misspelled or unknown control sequence}
  3844.  
  3845. Using a misspelled or other control sequence unknown to \TeX{} is
  3846. a common error.  If \TeX{} is being run as a batch job, an error
  3847. message is printed and the job goes on ignoring the control
  3848. sequence.  When using \TeX{} interactively, it is possible to
  3849. repair errors (of course this does not change the original input
  3850. file, so that must be done when the \TeX{} job is completed).
  3851. Suppose we have a \TeX{} input file consisting of the following
  3852. two lines:
  3853. \beginuser
  3854. \\line\lb The left side \\hfli the right side\rb
  3855. \\bye
  3856. \enduser
  3857.  
  3858. The control word should be {\tt \\hfil}, of course. Here is the
  3859. message that would be sent to your terminal:
  3860.  
  3861. \beginuser
  3862. \obeyspaces
  3863. ! Undefined  control sequence.
  3864. l.1 \\line\lb The left side \\hfli
  3865. \                               the right side\rb
  3866. ?
  3867. \enduser
  3868.  
  3869. The first line starts with {\tt !} and gives the error message.
  3870. Next comes the line number on which the error occurred and the
  3871. part of the line that was read successfully.  The next line gives
  3872. the continuation of the line after the error. At this point the
  3873. question mark means that \TeX{} is waiting for a response.  There
  3874. are several legal ones:
  3875. \nobreak
  3876. \maketable [Responses to \TeX{} error messages]
  3877. \halign{
  3878. \strut \hfil # \hfil & \quad \hfil \tt # \hfil & # \hfil\cr
  3879.    \bf Desired response & \bf Input to \TeX{} & \bf \hfil Result\cr
  3880.    \noalign{\hrule} \noalign{\smallskip}
  3881.    Help   & h<CR>& Reason for stopping listed on terminal.\cr
  3882.    Insert & i<CR>& Next line inserted into \TeX{} input file.\cr
  3883.    Exit   & x<CR>& Exit from \TeX\null. Completed pages to DVI file.\cr
  3884.    Scroll & s<CR>& List message and continue after minor errors.\cr
  3885.    Run    & r<CR>& List message and continue after any errors.\cr
  3886.    Quiet  & q<CR>& All terminal listings suppressed.\cr
  3887.    Carry on &<CR> & \TeX{} continues as best it can.\cr
  3888.       }
  3889.  
  3890. In our last example a reasonable response might be to enter {\tt
  3891. h<CR>} to get a help message, then {\tt i<CR>} to insert more
  3892. text, (at which point \TeX{} responds with {\tt insert> } and
  3893. finally {\tt \\hfil} as the correct control word.  Here is the
  3894. result:
  3895.  
  3896.  
  3897. \beginuser
  3898. ? h <CR>
  3899. The control sequence at the end of the top line
  3900. of your error message was never \\def'ed. If you have
  3901. misspelled it (e.g., `\\hobx'), type `I' and the correct
  3902. spelling (e.g., `I\\hbox'). Otherwise just continue,
  3903. and I'll forget about whatever was undefined.
  3904.  
  3905. ? i <CR>
  3906. insert>\\hfil
  3907. [1]
  3908. \enduser
  3909.  
  3910. The final {\tt [1]} means that the first (and only) page has
  3911. been completed and sent to the DVI file.  The original input file
  3912. still needs to be fixed, of course.
  3913.  
  3914. \subsection{The misnamed font}
  3915.  
  3916. A misspelled font name is an error similar to the misspelled
  3917. control sequence.  The error message is different and a little
  3918. confusing at first. Suppose for example the following appears in
  3919. your input file:
  3920.  
  3921. \leftline{\tt \\font\\sf = cmss01}
  3922.  
  3923. It should be {\tt cmss10}, that is, the numbers have been
  3924. transposed.  Here are the error and help messages:
  3925.  
  3926. \beginuser \obeyspaces
  3927. ! Font \\sf=cmss01 not loadable: Metric (TFM) file not found.
  3928. <to be read again>
  3929. \                   \\par
  3930. \\bye ->\\par
  3931. \            \\vfill \\supereject \\end
  3932. l.2 \\bye
  3933.  
  3934. ? h <CR>
  3935. I wasn't able to read the size data for this font,
  3936. so I will ignore the font specification.
  3937. [Wizards can fix TFM files using TFtoPL/PLtoTF.]
  3938. You might try inserting a different font spec;
  3939. e.g., type `I\\font<same font id>=<substitute font name>'.
  3940. \enduser
  3941.  
  3942. The TFM (\TeX{} font metric) file is an auxiliary file that is
  3943. used by \TeX\null. So this strange message is just telling you
  3944. that the font you defined doesn't exist on your computer system.
  3945.  
  3946. \subsection{Mismatched mathematics}
  3947.  
  3948. Another common error is to use {\tt \$} or {\tt \$\$} to start a
  3949. mathematical expression and then to forget the second {\tt \$}
  3950. or {\tt \$\$} when finished.  The text that follows is then
  3951. treated as mathematics, and to make matters worse, if more
  3952. mathematics is started by a new {\tt \$} or {\tt \$\$}, it will
  3953. then be treated as ordinary text.  Needless to say, error
  3954. messages galore may be generated. \TeX{} will attempt to correct
  3955. the problem by inserting a new {\tt \$} or {\tt \$\$}; in any
  3956. case, the problem is corrected by the end of the paragraph since
  3957. a new paragraph will automatically start as ordinary text.
  3958.  
  3959. Consider the following correct input and its output:
  3960. \beginuser
  3961. Since \$f(x) > 0\$, \$a<b\$,  and \$f(x)\$ is continuous, we know that
  3962. \$\\int\_{}a\^{}b f(x)\\,dx >0\$.
  3963. \enduser
  3964.  
  3965. Since $f(x) > 0$, $a<b$,  and $f(x)$ is continuous, we know that
  3966. $\int_a^b f(x)\,dx >0$.
  3967.  
  3968. If we now leave out the second dollar sign in {\tt \$f(x)\$} we
  3969. then get the following error and help messages:
  3970.  
  3971. \beginuser \obeyspaces
  3972. ! Missing \$ inserted.
  3973. <inserted text>
  3974. \               \$
  3975. <to be read again>
  3976. \                  \\intop
  3977. \\int ->\\intop
  3978. \             \\nolimits
  3979. l.2 \$\\int
  3980. \          \_{}a\^{}b f(x)\\,dx >0\$.
  3981. ? h <CR>
  3982. I've inserted a begin-math/end-math symbol since I think
  3983. you left one out. Proceed, with fingers crossed.
  3984.  
  3985. ?
  3986. \enduser
  3987.  
  3988. The line starting with {\tt !} tells us what has been done. The
  3989. line starting with {\tt l.2} shows us where we were in the input
  3990. file when the error occurred.  As in our other examples, the part
  3991. of the line successfully read, that is, through {\tt \\int},
  3992. appears on one line, and the continuation appears on the next
  3993. line. The remaining material may seem somewhat obscure.  These
  3994. intermediate messages show what was happening further in the guts
  3995. of the \TeX{} program when the error occurred.  The newer user
  3996. may ignore them.
  3997.  
  3998. Here is what you get as output after \TeX{} tries to recover from
  3999. the error.
  4000.  
  4001. Since $f(x) > 0$, $a<b$,  and $f(x) is continuous, we know that
  4002. \int_a^b f(x)\,dx >0$.
  4003.  
  4004. There is a stretch of text that is italic with no spacing.  This
  4005. is typical for normal text being processed as mathematics; if you
  4006. see this in your output, you have almost certainly left out a
  4007. {\tt \$} or {\tt \$\$}.
  4008.  
  4009. \subsection{Mismatched braces}
  4010.  
  4011. It's easy to forget or mismatch the closing braces when making
  4012. groups.  The result may be a relatively benign error, or it may
  4013. be catastrophic. Suppose, for example, you have {\tt \lb\\bf A
  4014. bold title } in your text with the closing right brace omitted.
  4015. The result will be the same as if no opening brace were there;
  4016. that is, the rest of the paper will be boldface if no other font
  4017. changes are made.  You will get the following message at the end
  4018. of the file:
  4019.  
  4020. {\tt (\\end occurred inside a group at level 1)}
  4021.  
  4022. If you had made the same mistake twice, then there would be two
  4023. more opening braces than closing braces, and you would get the
  4024. message:
  4025.  
  4026. {\tt (\\end occurred inside a group at level 2)}
  4027.  
  4028. \TeX{} doesn't know that the closing brace is missing until it
  4029. reaches the end of the input file.  Hence the message doesn't
  4030. tell you where you went wrong.  If the location of the missing
  4031. brace isn't obvious, it's always possible to insert {\tt \\bye}
  4032. halfway through your document.  Running \TeX{} again will cause
  4033. only the first half to be processed, and if the error message
  4034. persists, you will know that the error is in the first half of
  4035. the document.  By moving the {\tt \\bye} to different places, the
  4036. error can be localized.  Also, looking at the output often
  4037. reveals what has gone wrong.
  4038.  
  4039. Missing opening braces are much easier to spot.  Here is a two
  4040. line input file and the resulting error and help messages:
  4041.  
  4042. \beginuser
  4043. \\bf Here is the start\rb, but there is the finish.
  4044. \\bye
  4045. \enduser
  4046.  
  4047. \beginuser \obeyspaces
  4048. ! Too many \rb's.
  4049. l.1 \\bf Here is the start\rb
  4050. \                          , but there is the finish.
  4051.  
  4052. ? h <CR>
  4053. You've closed more groups than you opened.
  4054. Such booboos are generally harmless, so keep going.
  4055. \enduser
  4056.  
  4057. It's quite possible, of course, that the line that is supposed to
  4058. have the missing left brace will not be on the line where \TeX{}
  4059. catches the error.
  4060.  
  4061. A mismatched brace in the definition of a new control sequence
  4062. can cause a major error.  Since such a definition may include
  4063. several paragraphs, it may not be caught by the end of a
  4064. paragraph, but, rather will just keep piling more and more text
  4065. into the unfinished definition.  It's even possible for \TeX{} to
  4066. run out of memory as it keeps eating up more text! This is called
  4067. a ``runaway definition''.
  4068. \TeXref{206}
  4069. Here is a two line input file with a runaway definition:
  4070.  
  4071. \vbox{
  4072. \beginuser
  4073. \\def\\newword\lb the def
  4074. \\newword
  4075. \\bye
  4076. \enduser
  4077. }
  4078.  
  4079. Here are the resulting error and help messages:
  4080.  
  4081. \beginuser \obeyspaces
  4082. Runaway definition?
  4083. ->the def
  4084. ! Forbidden control sequence found while scanning definition of \\newword.
  4085. <inserted text>
  4086. \                \rb
  4087. <to be read again>
  4088. \                   \\bye
  4089. l.3 \\bye
  4090.  
  4091. ? h <CR>
  4092. I suspect you have forgotten a `\rb', causing me
  4093. to read past where you wanted me to stop.
  4094. I'll try to recover; but if the error is serious,
  4095. you'd better type `E' or `X' now and fix your file.
  4096.  
  4097. ? <CR>
  4098. No pages of output.
  4099. \enduser
  4100.  
  4101. This is obviously a serious error.  If it occurs at the beginning
  4102. of a file (as in the previous example), there will be no output
  4103. at all!
  4104.  
  4105. If a closing brace is left out while using a macro with
  4106. parameters, the runaway definition will be terminated at the end
  4107. of the paragraph. So if {\tt \\def\\newword\#1\lb$\ldots$\rb} has
  4108. been defined and you use {\tt \\newword\lb$\dots$ } without the
  4109. closing brace, then at most one paragraph will be ruined.
  4110. \TeXref{205}
  4111.  
  4112. In short, when an error occurs, make a note of the line number to
  4113. see how much of the input file has been read, and also the line
  4114. starting with an exclamation point to get a short description of
  4115. the error. If the error is still not clear, ask \TeX{} for more
  4116. information by typing {\tt h<CR>}. For small errors, \TeX{} can
  4117. carry on quite a way if you just keep hitting the {\tt <CR>}.
  4118.  
  4119.  
  4120.  
  4121.  
  4122. \section{Digging a little deeper}
  4123.  
  4124. In this section we look at a few topics that allow \TeX{} to be
  4125. used with greater flexibility or efficiency.  As the documents
  4126. being produced get longer, different techniques can help make
  4127. their creation easier.
  4128.  
  4129. \subsection{Big files, little files}
  4130.  
  4131. \TeX{} can read and write files as it runs.  This makes it
  4132. possible to use files that are smaller and more convenient to
  4133. handle by creating a master file that reads the smaller files in
  4134. the proper order. This document, for example, consists of ten
  4135. sections plus an introduction.  In addition, there are macros
  4136. that are used for all sections. The macros can be put in a file
  4137. called, say, {\tt macros.tex}, the introduction can be put in {\tt
  4138. intro.tex}, and each section put in its own file.  The control
  4139. word {\tt \\input} is then used to read in a file.  In general,
  4140. {\tt \\input filename} will cause the file called {\tt
  4141. filename.tex} to be read in and processed immediately, just as if
  4142. the text of {\tt filename.tex} had been part of the file that
  4143. read it in.  This file may input other files. In fact it's often
  4144. convenient to make a single file that reads in smaller pieces,
  4145. perhaps as follows:
  4146. \toindex{input}
  4147.  
  4148. \beginuser
  4149. \\input macros
  4150. \\input intro
  4151. \\input sec1
  4152. \\input sec2
  4153. \\input sec3
  4154. \\input sec4
  4155. \\input sec5
  4156. \\input sec6
  4157. \\input sec7
  4158. \\input sec8
  4159. \\input sec9
  4160. \\input sec10
  4161. \enduser
  4162.  
  4163. While the text is still being heavily edited, it's possible to
  4164. process only some of the files by putting a {\tt \%} at the
  4165. beginning of each line that contains a file to be skipped (this
  4166. is sometimes called ``commenting out'' the unwanted files).
  4167.  
  4168. The {\tt \\input} control word also allows the use of
  4169. predesigned macros.  The macros for a memorandum, for example,
  4170. might be put in a file called {\tt memo.tex}.  These macros might
  4171. set up the right {\tt \\hsize}, {\tt \\vsize} and other
  4172. parameters, and might stamp the time and date.  Once this has
  4173. been set up, all memoranda may be started with {\tt \\input memo}
  4174. to make them come out with a common format.
  4175.  
  4176. Be sure that you don't have the control word {\tt \\bye} in your
  4177. input file or the \TeX{} program will stop at that point.
  4178.  
  4179. \exercise Make a \TeX{} input file that reads in a second file.
  4180. Try reading in the second file twice using the {\tt \\input}
  4181. control word twice.
  4182.  
  4183. \subsection{Larger macro packages}
  4184.  
  4185. Designing macros that can be used with many types of documents
  4186. is obviously useful.  Most universities, for example, have
  4187. specific and often complicated format requirements for theses.  A
  4188. collection of macros, that is, a macro package that meets all
  4189. these specifications could be somewhat time consuming to design
  4190. and could be quite long.  It is possible to use the {\tt \\input}
  4191. command to use such a macro package, just as it is possible to
  4192. use it with your own macros.  But \TeX{} has a better facility
  4193. for larger packages.
  4194.  
  4195. A macro package can be put in a special form that can be quickly
  4196. read by \TeX\null.  This is called a {\sl format file}, and
  4197. the exact form is of technical interest only.  The important
  4198. thing is it allows \TeX{} to be run with many new control
  4199. sequences predefined. Certain commands called {\sl primitives\/}
  4200. are part of the definition of \TeX\null.
  4201.  
  4202. What we have described in this manual is sometimes called {\sl
  4203. plain \TeX\/}, and consists of the \TeX{} primitives plus a set
  4204. of macros in a format file (that is usually included in \TeX{}
  4205. automatically) called {\tt plain.fmt}. For the curious, any
  4206. control word can be viewed using {\tt \\show}.  The command {\tt
  4207. \\show\\centerline} will display
  4208. \beginliteral
  4209. > \centerline=macro:
  4210. #1->\line {\hss #1\hss }.
  4211. @endliteral
  4212. \noindent
  4213. on the screen and in the log file. You can use {\tt \\show} with
  4214. your own macros, too.  If you end up using several macro
  4215. packages, you can use the {\tt \\show} command to see if a
  4216. particular macro is defined.
  4217.  
  4218. Many computer \centre{}s have the \LaTeX{} macro package.  This
  4219. package allows the user to create an index, a table of contents,
  4220. and a bibliography automatically.  It also has the ability to
  4221. insert some elementary graphic figures such as circles, ovals,
  4222. lines, and arrows. \LaTeX{} also uses special predefined files
  4223. called {\sl style files\/} to set up
  4224. specific page parameters. Many different style files are
  4225. available; some journals will accept papers on a magnetic medium
  4226. for direct processing if they are prepared using \LaTeX{} and a
  4227. designated style file. It is not difficult to shift from \TeX{}
  4228. to \LaTeX\null. A user's guide by the author of the macro
  4229. package, Leslie Lamport, is available:
  4230. {\bf \LaTeX{}: A document preparation system}%
  4231. \fnote{Addison-Wesley, Reading, Massachusetts, 1986,
  4232. ISBN 0-201-15790-X.}.
  4233.  
  4234. The American Mathematical Society uses the \AMSTeX{} macro
  4235. package for its journals.  It is readily available from that
  4236. Society, and papers may be submitted to their journals on a
  4237. magnetic medium using \AMSTeX\null.  A manual by Michael Spivak,
  4238. {\bf The Joy of \TeX{}}\fnote{American Mathematical
  4239. Society, 1986, ISBN 0-8218-2999-8}, is available from the
  4240. American Mathematical Society.
  4241.  
  4242. Other macro packages exist, and undoubtedly more will be
  4243. developed. They are usually of modest cost and can be very
  4244. effective in some circumstances.  The \TeX{} Users Group
  4245. announces the existence of new macro packages in its
  4246. publications.
  4247.  
  4248. \subsection{Horizontal and vertical lines}
  4249.  
  4250. Making horizontal and vertical lines is easy using \TeX\null.
  4251. When typing in text, {\tt \\hrule } will cause the current
  4252. paragraph to end, will draw a horizontal line whose width is the
  4253. current value of {\tt \\hsize}, and then will continue on with a
  4254. new paragraph.  It's possible to specify the width of the hrule
  4255. as, for example, with {\tt \\hrule width 5 cm}; also you can use
  4256. {\tt \\vskip} or {\tt \\bigskip} to put some space above or below
  4257. the hrule.  Here is an example:
  4258.  
  4259. \beginuser
  4260. \\parindent = 0 pt \\parskip = 12 pt
  4261. Here is the text before the hrule.
  4262. \\bigskip
  4263. \\hrule width 3 in
  4264. And here is some text after the hrule.
  4265. \enduser
  4266.  
  4267. \noindent that produces
  4268. \vfill\eject
  4269.  
  4270. {
  4271. \parindent = 0 pt
  4272. Here is the text before the hrule.
  4273. \bigskip
  4274. \hrule width 3 in
  4275. And here is some text after the hrule.
  4276. }
  4277.  
  4278. In fact this hrule not only has width of three inches, but also
  4279. by default has a height (the amount by which the hrule extends
  4280. above the baseline on which the type is being set) of 0.4 points
  4281. and a depth (the amount by which the hrule extends below the
  4282. baseline on which the type is being set) of 0 points.  Each of
  4283. these parameters can be individually set.  Thus if we change the
  4284. last example to say
  4285.  
  4286. {\tt \\hrule width 3 in height 2 pt depth 3 pt } we get
  4287.  
  4288. {
  4289. \parindent = 0 pt
  4290. Here is the text before the hrule.
  4291. \bigskip
  4292. \hrule width 3 in height 2 pt depth 3 pt
  4293. And here is some text after the hrule.
  4294. }
  4295.  
  4296. The three parameters {\tt width}, {\tt height}, and {\tt depth} may
  4297. be given in any order.
  4298. \toindex{hrule}
  4299. \TeXref{221--222}
  4300.  
  4301. A vrule may be defined analogously to an hrule by specifying the
  4302. {\tt width}, {\tt height}, and {\tt depth} if desired.
  4303. \TeXref{221--222}
  4304. But, unlike the hrule, the vrule will not automatically start a
  4305. new paragraph when it appears.  By default the vrule will be 0.4
  4306. points wide, and will be as high as the line on which it is being
  4307. set. Hence
  4308.  
  4309. \toindex{vrule}
  4310.  
  4311. \beginuser
  4312. Here is some text before the vrule
  4313. \\vrule\\
  4314. and this follows the vrule.
  4315. \enduser
  4316.  
  4317. \noindent will give
  4318.  
  4319. Here is some text before the vrule
  4320. \vrule\
  4321. and this follows the vrule.
  4322.  
  4323. \exercise Make three horizontal lines that are 15 points apart,
  4324. 3 inches in length, and one inch in from the left margin.
  4325.  
  4326. Although we usually think of hrules and vrules as horizontal and
  4327. vertical lines, they need not necessarily be used that way.  For
  4328. example:
  4329.  
  4330. \beginuser
  4331. \\noindent
  4332. Name: \\vrule height 0 pt depth 0.4 pt width 3 in
  4333. \enduser
  4334.  
  4335. \noindent will give
  4336.  
  4337. \noindent
  4338. Name: \vrule height 0 pt depth 0.4 pt width 3 in
  4339.  
  4340. \exercise Make the following grid (each box is 1 \centimetre{} square):
  4341. \medskip
  4342. \settabs \+ \hskip 1cm&\hskip 1 cm&\hskip 1 cm& \cr
  4343. \moveright 2 in
  4344. \vbox{
  4345. \hrule width 3 cm
  4346. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  4347.   & \vrule height 1 cm \cr
  4348. \hrule width 3 cm
  4349. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  4350.   & \vrule height 1 cm \cr
  4351. \hrule width 3 cm
  4352. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  4353.   & \vrule height 1 cm \cr
  4354. \hrule width 3 cm
  4355. }
  4356.  
  4357.  
  4358. \subsection{Boxes within boxes}
  4359.  
  4360. We have already seen (in our discussion of line shapes) that
  4361. vboxes and hboxes are objects that may be overfull or underfull.
  4362. In this section we will look at these boxes in a bit more detail.
  4363. They may be stacked or lined up to allow a variety of positions
  4364. for text on the page.
  4365.  
  4366. An hbox is formed by using {\tt \\hbox\lb $\ldots$\rb}\null.
  4367. Once the material between the braces has been put into an hbox,
  4368. it is set and can not be further split (this means that material
  4369. that must go on one line can be put into an hbox, and it will
  4370. then remain as one unit).  It's possible to specify the size of
  4371. an hbox.\TeXref{64--66} Thus {\tt \\hbox to 5 cm\lb contents of
  4372. the box\rb } will produce an hbox exactly five \centimetre{}s
  4373. wide containing the typeset text ``contents of the box''.
  4374. It's easy to get an underfull or overfull box in this way. An
  4375. underfull box can be avoided by using {\tt \\hfil} to absorb the
  4376. extra space. When no dimension is given, an hbox is formed that
  4377. is just wide enough to hold the enclosed text.
  4378. \toindex{hbox}
  4379.  
  4380. Similarly, vboxes are formed using {\tt \\vbox\lb $\ldots$\rb}.
  4381. What makes these boxes interesting is that when a vbox contains
  4382. hboxes, these hboxes are stacked one above the other and set as a
  4383. unit. Similarly, an hbox can contain vboxes, which will be set in
  4384. a row. Suppose we take three hboxes and put them in a vbox:
  4385. \toindex{vbox}
  4386.  
  4387. \beginuser \obeyspaces
  4388. \\vbox\lb
  4389. \      \\hbox\lb{}Contents of box 1\rb
  4390. \      \\hbox\lb{}Contents of box 2\rb
  4391. \      \\hbox\lb{}Contents of box 3\rb
  4392. \      \rb
  4393. \enduser
  4394.  
  4395. \noindent gives
  4396. \vskip \baselineskip
  4397. \vbox{
  4398.       \hbox{Contents of box 1}
  4399.       \hbox{Contents of box 2}
  4400.       \hbox{Contents of box 3}
  4401.       }
  4402.  
  4403. Now suppose we take another vbox:
  4404.  
  4405. \beginuser \obeyspaces
  4406. \\vbox\lb
  4407. \      \\hbox\lb{}Contents of box 4\rb
  4408. \      \\hbox\lb{}Contents of box 5\rb
  4409. \      \rb
  4410. \enduser
  4411.  
  4412. These two vboxes can be put into an hbox; this will cause them to
  4413. be placed side by side. In other words
  4414.  
  4415. \beginuser \obeyspaces
  4416. \\hbox\lb
  4417. \     \\vbox\lb
  4418. \           \\hbox\lb{}Contents of box 1\rb
  4419. \           \\hbox\lb{}Contents of box 2\rb
  4420. \           \\hbox\lb{}Contents of box 3\rb
  4421. \           \rb
  4422. \     \\vbox\lb
  4423. \           \\hbox\lb{}Contents of box 4\rb
  4424. \           \\hbox\lb{}Contents of box 5\rb
  4425. \           \rb
  4426. \     \rb
  4427. \enduser
  4428.  
  4429. \noindent gives
  4430. \vskip \baselineskip
  4431. \hbox{
  4432.      \vbox{
  4433.            \hbox{Contents of box 1}
  4434.            \hbox{Contents of box 2}
  4435.            \hbox{Contents of box 3}
  4436.            }
  4437.      \vbox{
  4438.            \hbox{Contents of box 4}
  4439.            \hbox{Contents of box 5}
  4440.           }
  4441.      }
  4442.  
  4443.  
  4444. Notice that the two vboxes are aligned so that the bottoms are
  4445. level; also there is a little space at the beginning of each line
  4446. and also between the vboxes.  Actually, the reason these spaces
  4447. appear is rather subtle. Unless a line ends in a control word,
  4448. there is always a space between the last entry in one line and
  4449. the first one in the next line. For this reason the space between
  4450. the vboxes comes from the end of the line containing the closing
  4451. brace of the first vbox.  Similarly, the space at the beginning
  4452. of the line is caused by the space after the opening brace of the
  4453. hbox. These spaces can be avoided by ``commenting out'' the end of
  4454. the line, that is, by putting a {\tt \%} immediately after the
  4455. closing brace of the first vbox or the opening brace of the hbox.
  4456. If you try to put some vboxes together and accidentally get extra
  4457. space by forgetting to comment out the end of the line, you're in
  4458. good company.  Some very able and experienced \TeX{} users have
  4459. done the same thing!
  4460.  
  4461. Extra space, say one \centimetre,  can be added by putting an
  4462. {\tt \\hskip 1 cm } between the vboxes.  They can be aligned so
  4463. that the tops are level by using {\tt \\vtop } instead of
  4464. {\tt \\vbox}.  Making these two changes results in:
  4465.  
  4466. \toindex{vtop}
  4467. \vskip \baselineskip
  4468. \hbox{
  4469.      \vtop{
  4470.            \hbox{Contents of box 1}
  4471.            \hbox{Contents of box 2}
  4472.            \hbox{Contents of box 3}
  4473.            }
  4474.      \hskip 1 cm
  4475.      \vtop{
  4476.            \hbox{Contents of box 4}
  4477.            \hbox{Contents of box 5}
  4478.           }
  4479.      }
  4480.  
  4481.  
  4482. We can combine vboxes, hboxes, vrules, and hrules to get boxed
  4483. text.  How might we construct such a box? One way is to take the
  4484. material to be boxed and put it in an hbox preceded and followed
  4485. by a vrule.  Then put this in a vbox with hrules above and below
  4486. it. This gives us:
  4487.  
  4488. \beginuser \obeyspaces
  4489. \\vbox\lb
  4490. \      \\hrule
  4491. \      \\hbox\lb\\vrule\lb\rb The text to be boxed \\vrule\rb
  4492. \      \\hrule
  4493. \     \rb
  4494. \enduser
  4495.  
  4496. \noindent which results in
  4497. \vskip \baselineskip
  4498. \vbox{
  4499.       \hrule
  4500.       \hbox{\vrule{} The text to be boxed \vrule}
  4501.       \hrule
  4502.      }
  4503.  
  4504. This produces boxed material, but there is no margin around it
  4505. and so it looks very cramped (of course \TeX{} is just giving us
  4506. what we asked for).  We can improve the spacing by putting a {\tt
  4507. \\strut} at the beginning of the hbox to make it a little taller
  4508. and deeper.  This gives us:
  4509. \vskip \baselineskip
  4510. \vbox{
  4511.       \hrule
  4512.       \hbox{\strut \vrule{} The text to be boxed \vrule}
  4513.       \hrule
  4514.      }
  4515.  
  4516. \def\boxtext#1{%
  4517. \vbox{%
  4518.       \hrule
  4519.       \hbox{\strut \vrule{} #1 \vrule}%
  4520.       \hrule
  4521.      }%
  4522. }
  4523.  
  4524. \exercise Why is it that we were forced to add extra space above
  4525. and below the text but not before and after it?
  4526.  
  4527.  
  4528. \exercise Use the method of boxing material to put text \centred{}
  4529. in a box which extends from the left to the right margin.
  4530.  
  4531. \exercise By stacking nine little boxes, make the following magic square:
  4532. \vskip\baselineskip
  4533.  
  4534. \moveright 2 in \vbox{\offinterlineskip
  4535. \hbox{\boxtext 6\boxtext 1\boxtext 8}
  4536. \hbox{\boxtext 7\boxtext 5\boxtext 3}
  4537. \hbox{\boxtext 2\boxtext 9\boxtext 4}
  4538. }
  4539.  
  4540. \exercise Notice that the magic square in the previous exercise
  4541. has internal lines that are twice as thick as the outside ones.
  4542. Also, there is a tiny space at the intersection of the internal
  4543. lines. Fix up the magic square so this doesn't happen.
  4544.  
  4545. \def\boxtext#1 {%
  4546. \vbox{%
  4547.       \hrule
  4548.       \hbox{\strut \vrule #1\vrule}%
  4549.       \hrule
  4550.      }
  4551. }
  4552.  
  4553. \exercise Write a macro { \tt \\boxtext\#1\lb$\ldots$\rb } which
  4554. will take the text between the braces and put a box around it.  Test
  4555. your macro by making up a sentence with every other word boxed.
  4556. I'm \boxtext not quite \boxtext sure why \boxtext someone
  4557. would \boxtext do this \boxtext since the \boxtext result is \boxtext
  4558. pretty strange. Note how the baseline and the bottom of
  4559. the surrounding boxes align.
  4560.  
  4561. \def\boxtext#1 {%
  4562. \lower 3.5pt \hbox{%
  4563.     \vbox{%
  4564.          \hrule
  4565.          \hbox{\strut \vrule #1\vrule}%
  4566.          \hrule
  4567.         }
  4568.     }%
  4569. }
  4570.  
  4571. It's easy to move boxes up, down, left, or right on the page. A
  4572. {\tt \\vbox} can be moved to the right one inch by using {\tt
  4573. \\moveright 1 in \\vbox\lb\dots\rb}.  To move it to the left,
  4574. use {\tt \\moveleft}.  Similarly, an {\tt \\hbox} can be moved up
  4575. or down using {\tt \\raise} or {\tt \\lower}.
  4576. \toindex{moveright}
  4577. \toindex{moveleft}
  4578. \toindex{raise}
  4579. \toindex{lower}
  4580.  
  4581. \exercise Rewrite the {\tt \\boxtext} macro from the previous
  4582. exercise so that all of the text is aligned (hint: by default the
  4583. depth of a strut is 3.5 points).  This would give a sentence like
  4584. the following: I'm \boxtext not quite \boxtext sure why \boxtext
  4585. someone would \boxtext do this \boxtext since the \boxtext result
  4586. is \boxtext pretty strange.
  4587.  
  4588. It's possible to fill a box with either an hrule or with dots.
  4589. The idea is to use {\tt \\hrulefill } or {\tt \\dotfill } in the
  4590. hbox.
  4591.  
  4592. \beginuser
  4593. \\hbox to 5 in\lb Getting Started\\hrulefill 1\rb
  4594. \\hbox to 5 in\lb All Characters Great and Small\\hrulefill 9\rb
  4595. \\hbox to 5 in\lb The Shape of Things to come\\hrulefill 17\rb
  4596. \\hbox to 5 in\lb No Math Anxiety Here!\\hrulefill 30\rb
  4597. \enduser
  4598.  
  4599. \noindent gives
  4600. \vskip \baselineskip
  4601.  
  4602. \hbox to 5 in{Getting Started\hrulefill 1}
  4603. \hbox to 5 in{All Characters Great and Small\hrulefill 9}
  4604. \hbox to 5 in{The Shape of Things to come\hrulefill 17}
  4605. \hbox to 5 in{No Math Anxiety Here!\hrulefill 30}
  4606.  
  4607. If {\tt \\hrulefill} is replaced by {\tt \\dotfill} we get
  4608. \vskip \baselineskip
  4609.  
  4610. \hbox to 5 in{Getting Started\dotfill 1}
  4611. \hbox to 5 in{All Characters Great and Small\dotfill 9}
  4612. \hbox to 5 in{The Shape of Things to come\dotfill 17}
  4613. \hbox to 5 in{No Math Anxiety Here!\dotfill 30}
  4614.  
  4615. \exercise Make a boxed headline appear at the top of the page
  4616. that is like the one used in this manual.
  4617.  
  4618.  
  4619.  
  4620. \section{Control word list}
  4621.  
  4622. Here is a list of the control words given in this manual.
  4623. If you want more detail about these words than is given here,
  4624. check the index of {\bf The \TeX book}.
  4625.  
  4626. \vskip 2\baselineskip
  4627. \centerline{Control symbols}
  4628. \vskip\baselineskip
  4629.  
  4630. \settabs \+ \hskip 1.5 in & \hskip 1.65in & \hskip 1.3in & \cr
  4631. {\tt
  4632. \+  \\\sp{} 4 & \\!\ 34  & \\" 11 & \\' 11    \cr
  4633. \+  \\, 34    & \\.\ 11  & \\/ 16 & \\; 34    \cr
  4634. \+  \\= 11    & \\> 34   & \\\# 10&  \\\$ 6  \cr
  4635. \+  \\\% 6    & \\\& 10   & \\\char '173{} 10  & \\\char '175{} 10 \cr
  4636. \+  \\\underbar{ } 10 & \\` 11 & \\{\accent "7E } 10 & \\{\accent 94 } 10 \cr
  4637. \+  \\| 40 \cr
  4638. }
  4639.  
  4640. \vskip 2\baselineskip
  4641. \centerline{Control words}
  4642. \vskip\baselineskip
  4643.  
  4644. {\tt
  4645. \+ \\AA 12 & \\aa 12 & \\acute 36 & \\AE 12 \cr
  4646. \+ \\ae 12 & \\aleph 37 & \\alpha 35 & \\angle 37 \cr
  4647. \+ \\approx 37 & \\arccos 41 & \\arcsin 41 & \\arctan 41 \cr
  4648. \+ \\arg 41 & \\ast 36 & \\b 12 & \\backslash 37 \cr
  4649. \+ \\bar 36 & \\baselineskip 22 & \\beta 35 & \\bf 16 \cr
  4650. \+ \\biggl 40 & \\Biggl 40 & \\biggr 40 & \\Biggr 40 \cr
  4651. \+ \\bigl 40 & \\Bigl 40 & \\bigr 40 & \\Bigr 40 \cr
  4652. \+ \\bigskip 26 & \\break 26 & \\breve 36 & \\bullet 36 \cr
  4653. \+ \\bye 4 & \\c 12 & \\cap 36 & \\cdot 36 \cr
  4654. \+ \\centerline 26 & \\centreline 60 & \\check 36 & \\chi 35 \cr
  4655. \+ \\circ 35 & \\columns 48 & \\cos 41 & \\cosh 41 \cr
  4656. \+ \\cot 41 & \\coth 41 & \\csc 41& \\cup 36 \cr
  4657. \+ \\d 12 & \\ddag 27 & \\ddot 36 & \\def 55 \cr
  4658. \+ \\deg 41 & \\delta 35 & \\Delta 35 & \\det 41 \cr
  4659. \+ \\diamond 36 & \\dim 41 & \\div 36 & \\dot 36 \cr
  4660. \+ \\dotfill 49 & \\dots 14 & \\downarrow 41 & \\Downarrow 41 \cr
  4661. \+ \\eject 20 & \\ell 37 & \\endinsert 26 & \\epsilon 35 \cr
  4662. \+ \\eqalign 45 & \\eqalignno 46 & \\eqno 46 & \\equiv 37 \cr
  4663. \+ \\eta 35 & \\exists 37 & \\exp 41 & \\flat 37 \cr
  4664. \+ \\folio 28 & \\font 16 & \\footline 28 & \\footnote 27 \cr
  4665. \+ \\forall 37 & \\gamma 35 & \\Gamma 35 & \\gcd 41 \cr
  4666. \+ \\geq 37 & \\grave 36 & \\H 12 & \\halign 51 \cr
  4667. \+ \\hang 23 & \\hangafter 23 & \\hangindent 23 & \\hat 36 \cr
  4668. \+ \\hbadness 29 & \\hbox 72 & \\headline 28 & \\hfil 27 \cr
  4669. \+ \\hfill 26 & \\hfuzz 29 & \\hoffset 20 & \\hom 41 \cr
  4670. \+ \\hrule 71 & \\hrulefill 49 & \\hsize 20 & \\hskip 27 \cr
  4671. \+ \\hyphenation 30 & \\i 11 & \\Im 37 & \\in 37 \cr
  4672. \+ \\inf 41 & \\infty 37 & \\input 68 & \\int 38 \cr
  4673. \+ \\iota 35 & \\it 16 & \\item 24 & \\itemitem 24 \cr
  4674. \+ \\j 11 & \\kappa 35 & \\ker 41 & \\L 12 \cr
  4675. \+ \\l 12 &  \\lambda 35 & \\Lambda 35 & \\langle 41 \cr
  4676. \+ \\lceil 41 &  \\left 44 & \\leftline 26 & \\leftskip 23 \cr
  4677. \+ \\leq 37 &  \\leqalignno 46 & \\leqno 46 & \\let 61 \cr
  4678. \+ \\lfloor 41 &  \\lg 41 & \\lim 38 & \\liminf 41 \cr
  4679. \+ \\limsup 41 &  \\line 26 & \\ln 41 & \\log 41 \cr
  4680. \+ \\lower 75 &  \\magnification 21 & \\magstep 16 & \\matrix 44 \cr
  4681. \+ \\max 41 &  \\medskip 26 & \\min 41 & \\moveleft 75 \cr
  4682. \+ \\moveright 75 &  \\mu 35 & \\nabla 37 & \\narrower 23 \cr
  4683. \+ \\natural 37 &  \\neg 37 & \\ni 37 & \\noalign 52 \cr
  4684. \+ \\noindent 22 &  \\nopagenumbers 5 & \\not 36 & \\nu 35 \cr
  4685. \+ \\O 12 &  \\o 12 & \\odot 36 & \\OE 12 \cr
  4686. \+ \\oe 12 &  \\offinterlineskip 53 & \\omega 35 & \\Omega 35 \cr
  4687. \+ \\ominus 36 &  \\oplus 36 & \\otimes 36 & \\over 37 \cr
  4688. \+ \\overfullrule 29 &  \\overline 39 & \\P 27 & \\pageno 28 \cr
  4689. \+ \\par 7 &  \\parallel 37 & \\parindent 23 & \\parshape 24 \cr
  4690. \+ \\parskip 22 &  \\partial 37 & \\perp 37 & \\phi 35 \cr
  4691. \+ \\Phi 35 &  \\pi 35 & \\Pi 35 & \\pmatrix 43 \cr
  4692. \+ \\Pr 41 &  \\proclaim 42 & \\psi 35 & \\Psi 35 \cr
  4693. \+ \\qquad 34 &  \\quad 34 & \\raggedright 27 & \\raise 75 \cr
  4694. \+ \\rangle 41 &  \\rceil 41 & \\Re 37 & \\rfloor 41 \cr
  4695. \+ \\rho 35 &  \\right 44 & \\rightline 26 & \\rightskip 23 \cr
  4696. \+ \\rm 16 &  \\root 39 & \\S 27 & scaled 16 \cr
  4697. \+ \\sec 41 &  \\settabs 48 & \\sharp 37 & \\sigma 35 \cr
  4698. \+ \\Sigma 35 &  \\sim 37 & \\simeq 37 & \\sin 41 \cr
  4699. \+ \\sinh 41 &  \\sl 16 & \\smallskip 26 & \\sqroot 39 \cr
  4700. \+ \\ss 12 &  \\star 36 & \\strut 50 & \\subset 37 \cr
  4701. \+ \\subseteq 37 &  \\sum 38 & \\sup 41 & \\supset 37 \cr
  4702. \+ \\supseteq 37 &  \\surd 39 & \\t 12 & \\tan 41 \cr
  4703. \+ \\tanh 41 &  \\tau 35 & \\tensor 60 & \\TeX{} 5 \cr
  4704. \+ \\tensor 60 &  \\the 28 & \\theta 35 & \\Theta 35 \cr
  4705. \+ \\tilde 36 &  \\times 36 & \\tolerance 29  & \\topinsert 26 \cr
  4706. \+ \\tt 16 &  \\u 12 & \\underbar 39 & \\underline 39 \cr
  4707. \+ \\uparrow 41 &  \\Uparrow 41 & \\updownarrow 41 & \\Updownarrow 41 \cr
  4708. \+ \\upsilon 35 &  \\Upsilon 35 & \\v 12 & \\varepsilon 35 \cr
  4709. \+ \\varphi 35 &  \\varrho 35 & \\varsigma 35 & \\vartheta 35 \cr
  4710. \+ \\vbadness 30 &  \\vbox 71 & \\vec 36 & \\vee 36 \cr
  4711. \+ \\vfill 20 &  \\vglue 25 & \\voffset 20 & \\vrule 71 \cr
  4712. \+ \\vsize 20 & \\vtop 74 &  \\wedge 36 & \\widehat 36 \cr
  4713. \+ \\widetilde 36 & \\xi 35 &  \\Xi 35 & \\zeta 35 \cr
  4714. }
  4715.  
  4716. \ifwritinganswers
  4717.    \let\next=\relax
  4718. \else
  4719.    \let\next=\endinput
  4720.    \datestamp
  4721. \fi
  4722.  
  4723. \next
  4724.  
  4725. \def\beginliteral{
  4726. \vskip\baselineskip
  4727. \begingroup
  4728. \obeylines
  4729. \tt
  4730. \catcode`\@=0\catcode`\~=12
  4731. \catcode`\$=12\catcode`\&=12\catcode`\^=12\catcode`\#=12
  4732. \catcode`\_=12\catcode`\=12
  4733. \def\par{\leavevmode\endgraf}
  4734. \catcode`\{=12\catcode`\}=12\catcode`\%=12\catcode`\\=12
  4735.  
  4736. }
  4737. \def\endliteral{\nobreak \vskip 6pt \endgroup}
  4738.  
  4739.  
  4740. \section{I get by with a little help}
  4741. Many of the exercises can be answered in several ways. If you
  4742. like your way better than the way given below, by all means use
  4743. it!
  4744. \vskip 2\baselineskip
  4745.  
  4746. \parskip=0pt \parindent=0pt
  4747. \raggedright
  4748. \hbadness=10000
  4749.  
  4750. \hrule
  4751. \beginliteral
  4752. I like \TeX!
  4753. Once you get the hang of it, \TeX\  is really easy to use.
  4754. You just have to master the \TeX nical aspects.
  4755. @endliteral
  4756. I like \TeX! Once you get the hang of it, \TeX\  is really easy
  4757. to use. You just have to master the \TeX nical aspects.
  4758. \vskip \baselineskip \hrule
  4759.  
  4760.  
  4761. \goodbreak \vskip 2pt \hrule
  4762. \beginliteral
  4763. Does \AE schylus understand \OE dipus?
  4764. @endliteral
  4765. Does \AE schylus understand \OE dipus?
  4766. \vskip \baselineskip \hrule
  4767.  
  4768. \goodbreak \vskip 2pt \hrule
  4769. \beginliteral
  4770. The smallest internal unit of \TeX{} is about 53.63\AA.
  4771. @endliteral
  4772. The smallest internal unit of \TeX{} is about 53.63\AA.
  4773. \vskip \baselineskip \hrule
  4774.  
  4775.  
  4776. \goodbreak \vskip 2pt \hrule
  4777. \beginliteral
  4778.  They took some honey and plenty of money wrapped up in a {\it \$}5 note.
  4779. @endliteral
  4780.  They took some honey and plenty of money wrapped up in a {\it \$}5 note.
  4781. \vskip \baselineskip \hrule
  4782.  
  4783.  
  4784. \goodbreak \vskip 2pt \hrule
  4785. \beginliteral
  4786.  \'El\`eves, refusez vos le\c cons! Jetez vos cha\^\i nes!
  4787. @endliteral
  4788.  \'El\`eves, refusez vos le\c cons! Jetez vos cha\^\i nes!
  4789. \vskip \baselineskip \hrule
  4790.  
  4791.  
  4792. \goodbreak \vskip 2pt \hrule
  4793. \beginliteral
  4794.  Za\v sto tako polako pijete \v caj?
  4795. @endliteral
  4796.  Za\v sto tako polako pijete \v caj?
  4797. \vskip \baselineskip \hrule
  4798.  
  4799.  
  4800. \goodbreak \vskip 2pt \hrule
  4801. \beginliteral
  4802.  Mein Tee ist hei\ss.
  4803. @endliteral
  4804.  Mein Tee ist hei\ss.
  4805. \vskip \baselineskip \hrule
  4806.  
  4807.  
  4808. \goodbreak \vskip 2pt \hrule
  4809. \beginliteral
  4810.  Peut-\^etre qu'il pr\'ef\`ere le caf\'e glac\'e.
  4811. @endliteral
  4812.  Peut-\^etre qu'il pr\'ef\`ere le caf\'e glac\'e.
  4813. \vskip \baselineskip \hrule
  4814.  
  4815. \goodbreak \vskip 2pt \hrule
  4816. \def\`{\relax\lq}
  4817. \beginliteral
  4818. ?@`Por qu\'e no bebes vino blanco? !@`Porque est\'a avinagrado!
  4819. @endliteral
  4820. ?`Por qu\'e no bebes vino blanco? !`Porque est\'a avinagrado!
  4821. \vskip \baselineskip \hrule
  4822.  
  4823. \goodbreak \vskip 2pt \hrule
  4824. \beginliteral
  4825.  M\'\i\'\j n idee\"en worden niet be\"\i nvloed.
  4826. @endliteral
  4827.  M\'\i\'\j n idee\"en worden niet be\"\i nvloed.
  4828. \vskip \baselineskip \hrule
  4829.  
  4830.  
  4831.  
  4832. \goodbreak \vskip 2pt \hrule
  4833. \beginliteral
  4834.  Can you take a ferry from \"Oland to \AA land?
  4835. @endliteral
  4836.  Can you take a ferry from \"Oland to \AA land?
  4837. \vskip \baselineskip \hrule
  4838.  
  4839.  
  4840. \goodbreak \vskip 2pt \hrule
  4841. \beginliteral
  4842.  T\"urk\c ce konu\c san ye\u genler nasillar?
  4843. @endliteral
  4844.  T\"urk\c ce konu\c san ye\u genler nasillar?
  4845. \vskip \baselineskip \hrule
  4846.  
  4847.  
  4848.  
  4849.  
  4850. \goodbreak \vskip 2pt \hrule
  4851. \beginliteral
  4852.  I entered the room and---horrors---I saw both my father-in-law and my
  4853. mother-in-law.
  4854. @endliteral
  4855.  I entered the room and---horrors---I saw both my father-in-law and my
  4856. mother-in-law.
  4857. \vskip \baselineskip \hrule
  4858.  
  4859.  
  4860. \goodbreak \vskip 2pt \hrule
  4861. \beginliteral
  4862. The winter of 1484--1485 was one of discontent.
  4863. @endliteral
  4864. The winter of 1484--1485 was one of discontent.
  4865. \vskip \baselineskip \hrule
  4866.  
  4867.  
  4868. \goodbreak \vskip 2pt \hrule
  4869. \beginliteral
  4870. His ``thoughtfulness'' was impressive.
  4871. @endliteral
  4872. His ``thoughtfulness'' was impressive.
  4873. \vskip \baselineskip \hrule
  4874.  
  4875.  
  4876. \goodbreak \vskip 2pt \hrule
  4877. \beginliteral
  4878.  Frank wondered, ``Is this a girl that can't say `No!'?''
  4879. @endliteral
  4880.  Frank wondered, ``Is this a girl that can't say `No!'?''
  4881. \vskip \baselineskip \hrule
  4882.  
  4883.  
  4884. \goodbreak \vskip 2pt \hrule
  4885. \beginliteral
  4886.  He thought, ``\dots and this goes on forever, perhaps to the last recorded
  4887. syllable.''
  4888. @endliteral
  4889.  He thought, ``\dots and this goes on forever, perhaps to the last recorded
  4890. syllable.''
  4891. \vskip \baselineskip \hrule
  4892.  
  4893.  
  4894. \goodbreak \vskip 2pt \hrule
  4895. \beginliteral
  4896.  Have you seen Ms.~Jones?
  4897. @endliteral
  4898.  Have you seen Ms.~Jones?
  4899. \vskip \baselineskip \hrule
  4900.  
  4901.  
  4902. \goodbreak \vskip 2pt \hrule
  4903. \beginliteral
  4904. Prof.~Smith and Dr.~Gold flew from
  4905. Halifax N.~S. to Montr\'eal, P.~Q. via Moncton, N.~B.
  4906. @endliteral
  4907. Prof.~Smith and Dr.~Gold flew from
  4908. Halifax N.~S. to Montr\'eal, P.~Q. via Moncton, N.~B.
  4909. \vskip \baselineskip \hrule
  4910.  
  4911.  
  4912. \goodbreak \vskip 2pt \hrule
  4913. \beginliteral
  4914. \line{left end \hfil left tackle \hfil left guard \hfil @centre \hfil
  4915. right guard \hfil right tackle \hfil right end}
  4916. @endliteral
  4917. \line{left end \hfil left tackle \hfil left guard \hfil \centre{} \hfil
  4918. right guard \hfil right tackle \hfil right end}
  4919. \vskip \baselineskip \hrule
  4920.  
  4921.  
  4922. \goodbreak \vskip 2pt \hrule
  4923. \beginliteral
  4924. \line{left \hfil \hfil right-@centre \hfil right}
  4925. @endliteral
  4926. \line{left \hfil \hfil right-\centre{} \hfil right}
  4927. \vskip \baselineskip \hrule
  4928.  
  4929.  
  4930. \goodbreak \vskip 2pt \hrule
  4931. \beginliteral
  4932. \line{\hskip 1 in ONE \hfil TWO \hfil THREE}
  4933. @endliteral
  4934. \line{\hskip 1 in ONE \hfil TWO \hfil THREE}
  4935. \vskip \baselineskip \hrule
  4936.  
  4937.  
  4938. \goodbreak \vskip 2pt \hrule
  4939. \beginliteral
  4940. i{f}f if{}f if{f}
  4941. @endliteral
  4942. i{f}f if{}f if{f}
  4943. \vskip \baselineskip \hrule
  4944.  
  4945.  
  4946. \goodbreak \vskip 2pt \hrule
  4947. \beginliteral
  4948. I started with roman type {\it switched to italic type}, and
  4949. returned to roman type.
  4950. @endliteral
  4951. I started with roman type {\it switched to italic type}, and
  4952. returned to roman type.
  4953. \vskip \baselineskip \hrule
  4954.  
  4955.  
  4956. \goodbreak \vskip 2pt \hrule
  4957. \beginliteral
  4958. $C(n,r) = n!/(r!\,(n-r)!)$
  4959. @endliteral
  4960. $C(n,r) = n!/(r!\,(n-r)!)$
  4961. \vskip \baselineskip \hrule
  4962.  
  4963.  
  4964. \goodbreak \vskip 2pt \hrule
  4965. \beginliteral
  4966. $a+b=c-d=xy=w/z$
  4967. $$a+b=c-d=xy=w/z$$
  4968. @endliteral
  4969. $a+b=c-d=xy=w/z$
  4970. $$a+b=c-d=xy=w/z$$
  4971. \vskip \baselineskip \hrule
  4972.  
  4973.  
  4974. \goodbreak \vskip 2pt \hrule
  4975. \beginliteral
  4976. $(fg)' = f'g + fg'$
  4977. $$(fg)' = f'g + fg'$$
  4978. @endliteral
  4979. $(fg)' = f'g + fg'$
  4980. $$(fg)' = f'g + fg'$$
  4981. \vskip \baselineskip \hrule
  4982.  
  4983.  
  4984. \goodbreak \vskip 2pt \hrule
  4985. \beginliteral
  4986. $\alpha\beta=\gamma+\delta$
  4987. $$\alpha\beta=\gamma+\delta$$
  4988. @endliteral
  4989. $\alpha\beta=\gamma+\delta$
  4990. $$\alpha\beta=\gamma+\delta$$
  4991. \vskip \baselineskip \hrule
  4992.  
  4993.  
  4994. \goodbreak \vskip 2pt \hrule
  4995. \beginliteral
  4996. $\Gamma(n) = (n-1)!$
  4997. $$\Gamma(n) = (n-1)!$$
  4998. @endliteral
  4999. $\Gamma(n) = (n-1)!$
  5000. $$\Gamma(n) = (n-1)!$$
  5001. \vskip \baselineskip \hrule
  5002.  
  5003. \goodbreak \vskip 2pt \hrule
  5004. \beginliteral
  5005. $x\wedge (y\vee z) = (x\wedge y) \vee (x\wedge z)$
  5006. @endliteral
  5007. $x\wedge (y\vee z) = (x\wedge y) \vee (x\wedge z)$
  5008. \vskip \baselineskip \hrule
  5009.  
  5010. \goodbreak \vskip 2pt \hrule
  5011. \beginliteral
  5012. $2+4+6+\cdots +2n = n(n+1)$
  5013. @endliteral
  5014. $2+4+6+\cdots +2n = n(n+1)$
  5015. \vskip \baselineskip \hrule
  5016.  
  5017.  
  5018. \goodbreak \vskip 2pt \hrule
  5019. \beginliteral
  5020. $\vec x\cdot \vec y  = 0$ if and only if $\vec x \perp \vec y$.
  5021. @endliteral
  5022. $\vec x\cdot \vec y  = 0$ if and only if $\vec x \perp \vec y$.
  5023. \vskip \baselineskip \hrule
  5024.  
  5025.  
  5026. \goodbreak \vskip 2pt \hrule
  5027. \beginliteral
  5028. $\vec x\cdot \vec y \not= 0$ if and only if $\vec x \not\perp \vec y$.
  5029. @endliteral
  5030. $\vec x\cdot \vec y \not= 0$ if and only if $\vec x \not\perp \vec y$.
  5031. \vskip \baselineskip \hrule
  5032.  
  5033.  
  5034. \goodbreak \vskip 2pt \hrule
  5035. \beginliteral
  5036. $(\forall x\in \Re)(\exists y\in\Re)$ $y>x$.
  5037. @endliteral
  5038. $(\forall x\in \Re)(\exists y\in\Re)$ $y>x$.
  5039. \vskip \baselineskip \hrule
  5040.  
  5041.  
  5042. \goodbreak \vskip 2pt \hrule
  5043. \beginliteral
  5044. ${a+b\over c}\quad {a\over b+c}\quad {1\over a+b+c} \not= {1\over a}+
  5045. {1\over b}+{1\over c}$.
  5046. @endliteral
  5047. ${a+b\over c}\quad {a\over b+c}\quad {1\over a+b+c} \not= {1\over a}+
  5048. {1\over b}+{1\over c}$.
  5049. \vskip \baselineskip \hrule
  5050.  
  5051.  
  5052. \goodbreak \vskip 2pt \hrule
  5053. \beginliteral
  5054. What are the points where ${\partial \over \partial x} f(x,y) = {\partial \over
  5055. \partial y} f(x,y) = 0$?
  5056. @endliteral
  5057. What are the points where ${\partial \over \partial x} f(x,y) = {\partial \over
  5058. \partial y} f(x,y) = 0$?
  5059. \vskip \baselineskip \hrule
  5060.  
  5061.  
  5062. \goodbreak \vskip 2pt \hrule
  5063. \beginliteral
  5064. $e^x \quad e^{-x} \quad e^{i\pi}+1=0 \quad x_0 \quad x_0^2
  5065. \quad {x_0}^2 \quad 2^{x^x}$.
  5066. @endliteral
  5067. $e^x \quad e^{-x} \quad e^{i\pi}+1=0 \quad x_0 \quad x_0^2
  5068. \quad {x_0}^2 \quad 2^{x^x}$.
  5069. \vskip \baselineskip \hrule
  5070.  
  5071.  
  5072. \goodbreak \vskip 2pt \hrule
  5073. \beginliteral
  5074. $\nabla^2 f(x,y) = {\partial^2 f \over\partial x^2}+ {\partial^2 f \over
  5075. \partial y^2}$.
  5076. @endliteral
  5077. $\nabla^2 f(x,y) = {\partial^2 f \over\partial x^2}+ {\partial^2 f \over
  5078. \partial y^2}$.
  5079. \vskip \baselineskip \hrule
  5080.  
  5081.  
  5082. \goodbreak \vskip 2pt \hrule
  5083. \beginliteral
  5084. $\lim_{x\to 0} (1+x)^{1\over x}=e$.
  5085. @endliteral
  5086. $\lim_{x\to 0} (1+x)^{1\over x}=e$.
  5087. \vskip \baselineskip \hrule
  5088.  
  5089.  
  5090. \goodbreak \vskip 2pt \hrule
  5091. \beginliteral
  5092. The cardinality of $(-\infty, \infty)$ is $\aleph_1$.
  5093. @endliteral
  5094. The cardinality of $(-\infty, \infty)$ is $\aleph_1$.
  5095. \vskip \baselineskip \hrule
  5096.  
  5097.  
  5098. \goodbreak \vskip 2pt \hrule
  5099. \beginliteral
  5100. $\lim_{x\to {0^+}} x^x = 1$.
  5101. @endliteral
  5102. $\lim_{x\to {0^+}} x^x = 1$.
  5103. \vskip \baselineskip \hrule
  5104.  
  5105.  
  5106. \goodbreak \vskip 2pt \hrule
  5107. \beginliteral
  5108. $\int_0^1 3x^2\,dx = 1$.
  5109. @endliteral
  5110. $\int_0^1 3x^2\,dx = 1$.
  5111. \vskip \baselineskip \hrule
  5112.  
  5113.  
  5114. \goodbreak \vskip 2pt \hrule
  5115. \beginliteral
  5116. $\sqrt2 \quad \sqrt {x+y\over x-y} \quad \root 3 \of {10}$ \quad $e^{\sqrt x}$.
  5117. @endliteral
  5118. $\sqrt2 \quad \sqrt {x+y\over x-y} \quad \root 3 \of {10}$ \quad $e^{\sqrt x}$.
  5119. \vskip \baselineskip \hrule
  5120.  
  5121.  
  5122. \goodbreak \vskip 2pt \hrule
  5123. \beginliteral
  5124. $\|x\| = \sqrt{x\cdot x}$.
  5125. @endliteral
  5126. $\|x\| = \sqrt{x\cdot x}$.
  5127. \vskip \baselineskip \hrule
  5128.  
  5129.  
  5130. \goodbreak \vskip 2pt \hrule
  5131. \beginliteral
  5132. $\phi(t) = {1 \over \sqrt{2\pi}} \int_0^t e^{-x^2/2}\,dx$.
  5133. @endliteral
  5134. $\phi(t) = {1 \over \sqrt{2\pi}} \int_0^t e^{-x^2/2}\,dx$.
  5135. \vskip \baselineskip \hrule
  5136.  
  5137.  
  5138. \goodbreak \vskip 2pt \hrule
  5139. \beginliteral
  5140. $\underline x \quad \overline y \quad \underline{\overline{x+y}}$.
  5141. @endliteral
  5142. $\underline x \quad \overline y \quad \underline{\overline{x+y}}$.
  5143. \vskip \baselineskip \hrule
  5144.  
  5145.  
  5146. \goodbreak \vskip 2pt \hrule
  5147. \beginliteral
  5148. $\bigl \lceil \lfloor x \rfloor \bigr \rceil \leq \bigl \lfloor \lceil x \rceil
  5149. \bigr \rfloor$.
  5150. @endliteral
  5151. $\bigl \lceil \lfloor x \rfloor \bigr \rceil \leq \bigl \lfloor \lceil x \rceil
  5152. \bigr \rfloor$.
  5153. \vskip \baselineskip \hrule
  5154.  
  5155.  
  5156. \goodbreak \vskip 2pt \hrule
  5157. \beginliteral
  5158. $\sin(2\theta) = 2\sin\theta\cos\theta
  5159. \quad \cos(2\theta) = 2\cos^2\theta - 1  $.
  5160. @endliteral
  5161. $\sin(2\theta) = 2\sin\theta\cos\theta
  5162. \quad \cos(2\theta) = 2\cos^2\theta - 1  $.
  5163. \vskip \baselineskip \hrule
  5164.  
  5165.  
  5166. \goodbreak \vskip 2pt \hrule
  5167. \beginliteral
  5168. $$\int \csc^2x\, dx = -\cot x+ C
  5169. \qquad \lim_{\alpha\to 0} {\sin\alpha \over \alpha} = 1
  5170. \qquad \lim_{\alpha\to \infty} {\sin\alpha \over \alpha} = 0.$$
  5171. @endliteral
  5172. $$\int \csc^2x\, dx = -\cot x+ C
  5173. \qquad \lim_{\alpha\to 0} {\sin\alpha \over \alpha} = 1
  5174. \qquad \lim_{\alpha\to \infty} {\sin\alpha \over \alpha} = 0.$$
  5175. \vskip \baselineskip \hrule
  5176.  
  5177.  
  5178. \goodbreak \vskip 2pt \hrule
  5179. \beginliteral
  5180. $$\tan(2\theta) = {2\tan\theta \over 1-\tan^2\theta}.$$
  5181. @endliteral
  5182. $$\tan(2\theta) = {2\tan\theta \over 1-\tan^2\theta}.$$
  5183. \vskip \baselineskip \hrule
  5184.  
  5185.  
  5186. \goodbreak \vskip 2pt \hrule
  5187. \beginliteral
  5188. \proclaim Theorem (Euclid). There exist an infinite number of primes.
  5189. @endliteral
  5190. \proclaim Theorem (Euclid). There exist an infinite number of primes.
  5191.  
  5192. \vskip \baselineskip \hrule
  5193.  
  5194.  
  5195. \goodbreak \vskip 2pt \hrule
  5196. \beginliteral
  5197. \proclaim Proposition 1.
  5198. $\root n \of {\prod_{i=1}^n X_i} \leq
  5199. {1 \over n} \sum_{i=1}^n X_i$ with equality if and only if $X_1=\cdots=X_n$.
  5200. @endliteral
  5201. \proclaim Proposition 1.
  5202. $\root n \of {\prod_{i=1}^n X_i} \leq
  5203. {1 \over n} \sum_{i=1}^n X_i$ with equality if and only if $X_1=\cdots=X_n$.
  5204.  
  5205. \vskip \baselineskip \hrule
  5206.  
  5207.  
  5208.  
  5209. \goodbreak \vskip 2pt \hrule
  5210. \beginliteral
  5211. $$ I_4 = \pmatrix{
  5212. 1 &0 &0 &0 \cr
  5213. 0 &1 &0 &0 \cr
  5214. 0 &0 &1 &0 \cr
  5215. 0 &0 &0 &1 \cr}$$
  5216. @endliteral
  5217. $$ I_4 = \pmatrix{
  5218. 1 &0 &0 &0 \cr
  5219. 0 &1 &0 &0 \cr
  5220. 0 &0 &1 &0 \cr
  5221. 0 &0 &0 &1 \cr}$$
  5222. \vskip \baselineskip \hrule
  5223.  
  5224.  
  5225. \goodbreak \vskip 2pt \hrule
  5226. \beginliteral
  5227. $$ |x| = \left\{ \matrix{
  5228. x & x \ge 0 \cr
  5229. -x & x \le 0 \cr} \right.$$
  5230. @endliteral
  5231. $$ |x| = \left\{ \matrix{
  5232. x & x \ge 0 \cr
  5233. -x & x \le 0 \cr} \right.$$
  5234. \vskip \baselineskip \hrule
  5235.  
  5236. \goodbreak \vskip 2pt \hrule
  5237. \beginliteral
  5238. \settabs \+ \hskip 2 in & \hskip .75in & \hskip 1cm& \cr
  5239. \+ &Plums &\hfill\$1&.22 \cr
  5240. \+ &Coffee &\hfill1&.78 \cr
  5241. \+ &Granola &\hfill1&.98 \cr
  5242. \+ &Mushrooms & &.63 \cr
  5243. \+ &{Kiwi fruit} & &.39 \cr
  5244. \+ &{Orange juice} &\hfill1&.09 \cr
  5245. \+ &Tuna &\hfill1&.29 \cr
  5246. \+ &Zucchini & &.64 \cr
  5247. \+ &Grapes &\hfill1&.69 \cr
  5248. \+ &{Smoked beef} & &.75 \cr
  5249. \+ &Broccoli &\hfill\underbar{\ \ 1}&\underbar{.09} \cr
  5250. \+ &Total &\hfill \$12&.55 \cr
  5251. @endliteral
  5252. \settabs \+ \hskip 2 in & \hskip .75in & \hskip 1cm& \cr
  5253. \+ &Plums &\hfill\$1&.22 \cr
  5254. \+ &Coffee &\hfill1&.78 \cr
  5255. \+ &Granola &\hfill1&.98 \cr
  5256. \+ &Mushrooms & &.63 \cr
  5257. \+ &{Kiwi fruit} & &.39 \cr
  5258. \+ &{Orange juice} &\hfill1&.09 \cr
  5259. \+ &Tuna &\hfill1&.29 \cr
  5260. \+ &Zucchini & &.64 \cr
  5261. \+ &Grapes &\hfill1&.69 \cr
  5262. \+ &{Smoked beef} & &.75 \cr
  5263. \+ &Broccoli &\hfill\underbar{\ \ 1}&\underbar{.09} \cr
  5264. \+ &Total &\hfill \$12&.55 \cr
  5265. \vskip \baselineskip \hrule
  5266.  
  5267.  
  5268. \goodbreak \vskip 2pt \hrule
  5269. \beginliteral
  5270. \settabs \+ \hskip 4.5 in & \cr
  5271. \+Getting Started \dotfill &1 \cr
  5272. \+All Characters Great and Small \dotfill &9 \cr
  5273. @endliteral
  5274. \settabs \+ \hskip 4.5 in & \cr
  5275. \+Getting Started \dotfill &1 \cr
  5276. \+All Characters Great and Small \dotfill &9 \cr
  5277. \vskip \baselineskip \hrule
  5278.  
  5279. \goodbreak \vskip 2pt \hrule
  5280. \beginliteral
  5281. \settabs \+ \hskip 1cm&\hskip 1 cm&\hskip 1 cm& \cr
  5282. \moveright 2 in
  5283. \vbox{
  5284. \hrule width 3 cm
  5285. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5286.   & \vrule height 1 cm \cr
  5287. \hrule width 3 cm
  5288. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5289.   & \vrule height 1 cm \cr
  5290. \hrule width 3 cm
  5291. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5292.   & \vrule height 1 cm \cr
  5293. \hrule width 3 cm
  5294. }
  5295. @endliteral
  5296. \settabs \+ \hskip 1cm&\hskip 1 cm&\hskip 1 cm& \cr
  5297. \moveright 2 in
  5298. \vbox{
  5299. \hrule width 3 cm
  5300. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5301.   & \vrule height 1 cm \cr
  5302. \hrule width 3 cm
  5303. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5304.   & \vrule height 1 cm \cr
  5305. \hrule width 3 cm
  5306. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5307.   & \vrule height 1 cm \cr
  5308. \hrule width 3 cm
  5309. }
  5310. \vskip \baselineskip \hrule
  5311.  
  5312.  
  5313. \goodbreak \vskip 2pt \hrule
  5314. \beginliteral
  5315. \def\boxtext#1{%
  5316. \vbox{%
  5317.       \hrule
  5318.       \hbox{\strut \vrule{} #1 \vrule}%
  5319.       \hrule
  5320.      }%
  5321. }
  5322. \moveright 2 in \vbox{\offinterlineskip
  5323. \hbox{\boxtext{6}\boxtext{1}\boxtext {8}}
  5324. \hbox{\boxtext{7}\boxtext{5}\boxtext{3}}
  5325. \hbox{\boxtext{2}\boxtext{9}\boxtext{4}}
  5326. }
  5327. @endliteral
  5328. \def\boxtext#1{%
  5329. \vbox{%
  5330.       \hrule
  5331.       \hbox{\strut \vrule{} #1 \vrule}%
  5332.       \hrule
  5333.      }%
  5334. }
  5335. \moveright 2 in \vbox{\offinterlineskip
  5336. \hbox{\boxtext 6\boxtext 1\boxtext 8}
  5337. \hbox{\boxtext 7\boxtext 5\boxtext 3}
  5338. \hbox{\boxtext 2\boxtext 9\boxtext 4}
  5339. }
  5340. \vskip \baselineskip \hrule
  5341.  
  5342.  
  5343. \vfill
  5344. \datestamp
  5345.  
  5346. \bye
  5347.